Deleting comment in artefact view causes undefined property error

Bug #1826937 reported by Robert Lyon on 2019-04-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Medium
Unassigned

Bug Description

[WAR] 7e (artefact/comment/lib.php:1465) Trying to get property of non-object
Call stack (most recent first):

    log_message("Trying to get property of non-object", 8, true, true, "/home/robertl/code/mahara-devel/mahara/htdocs/arte...", 1465) at /home/robertl/code/mahara-devel/mahara/htdocs/lib/errors.php:520
    error(8, "Trying to get property of non-object", "/home/robertl/code/mahara-devel/mahara/htdocs/arte...", 1465, array(size 13)) at /home/robertl/code/mahara-devel/mahara/htdocs/artefact/comment/lib.php:1465
    delete_comment_submit(object(Pieform), array(size 3)) at /home/robertl/code/mahara-devel/mahara/htdocs/lib/pieforms/pieform.php:544

This is because we are checking the view id rather than the artefact id the comment is attached to

To replicate:

1. Create 2 users.
2. Log in as user A and create a page containing an image block
3. Shared page with user B.
4. Log in as user B and comment on the image block.
5. Delete the comment.

Reviewed: https://reviews.mahara.org/9906
Committed: https://git.mahara.org/mahara/mahara/commit/751e070180d9a489e7b346adf60760215cb090ef
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 751e070180d9a489e7b346adf60760215cb090ef
Author: Robert Lyon <email address hidden>
Date: Tue Apr 30 09:09:42 2019 +1200

Bug 1826937: Check correct id when deleting the comment from artefact

behatnotneeded

Change-Id: Ibe357e17ac9b37380cb4fc6c9c21615db9137ac6
Signed-off-by: Robert Lyon <email address hidden>

Reviewed: https://reviews.mahara.org/9919
Committed: https://git.mahara.org/mahara/mahara/commit/7f688075e93cd7550360b8d27f40ebfd078ce6dd
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.04_STABLE

commit 7f688075e93cd7550360b8d27f40ebfd078ce6dd
Author: Robert Lyon <email address hidden>
Date: Tue Apr 30 09:09:42 2019 +1200

Bug 1826937: Check correct id when deleting the comment from artefact

behatnotneeded

Change-Id: Ibe357e17ac9b37380cb4fc6c9c21615db9137ac6
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 751e070180d9a489e7b346adf60760215cb090ef)

Robert Lyon (robertl-9) on 2019-04-30
Changed in mahara:
milestone: none → 19.04.0
importance: Undecided → Medium
status: New → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers