Tags under institutions cause error

Bug #1826788 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

We now have a system where we can use special 'Institution tags' but we also allow institution admins to tag things in the normal was as well. The following case causes the error:

[WAR] 9e (lib/form/elements/tags.php:100) 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-testing/mahara/htdocs/li...", 100) at /home/robertl/code/mahara-testing/mahara/htdocs/lib/errors.php:520
    error(8, "Trying to get property of non-object", "/home/robertl/code/mahara-testing/mahara/htdocs/li...", 100, array(size 3)) at /home/robertl/code/mahara-testing/mahara/htdocs/lib/form/elements/tags.php:100
    display_tag("fats", array(size 2)) at /home/robertl/code/mahara-testing/mahara/htdocs/artefact/file/lib.php:729
    ArtefactTypeFileBase::get_my_files_data(0null, null, "insttwo", null) at /home/robertl/code/mahara-testing/mahara/htdocs/lib/form/elements/filebrowser.php:164

Steps to reproduce:

1) Have a site with an institution (Institution A) that contains 2 institution admins
2) Institution admin A logs in and uploads a file to the Admin -> Institution -> Files section
3) They then edit the file metadata and add a tag 'Cats'
4) They log out
5) Institution admin B logs in and goes to the Admin -> Institution -> Files section

They see the error

6) They then edit the file metadata and instead of seeing 'Cats' they see 'null'

Robert Lyon (robertl-9)
Changed in mahara:
importance: Undecided → High
milestone: none → 19.04.0
status: New → Confirmed
Robert Lyon (robertl-9)
Changed in mahara:
assignee: nobody → Robert Lyon (robertl-9)
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/9894

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9894
Committed: https://git.mahara.org/mahara/mahara/commit/a4a8e6ae5426c4d5eb100bc57ebd3d64096f4178
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit a4a8e6ae5426c4d5eb100bc57ebd3d64096f4178
Author: Robert Lyon <email address hidden>
Date: Mon Apr 29 12:55:16 2019 +1200

Bug 1826788: Allow tags on institutions / group items still show

When tags on an artefact / view / collection / blocktype not owned
by a user, but rather a group or institution we should still display
it for a user who belongs to that group / institution

behatnotneeded

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

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "19.04_STABLE" branch: https://reviews.mahara.org/9916

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9916
Committed: https://git.mahara.org/mahara/mahara/commit/9c7f25de2c2185bbeb94302a1f5c2225f81dd2df
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 19.04_STABLE

commit 9c7f25de2c2185bbeb94302a1f5c2225f81dd2df
Author: Robert Lyon <email address hidden>
Date: Mon Apr 29 12:55:16 2019 +1200

Bug 1826788: Allow tags on institutions / group items still show

When tags on an artefact / view / collection / blocktype not owned
by a user, but rather a group or institution we should still display
it for a user who belongs to that group / institution

behatnotneeded

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

Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Steven (stevens-q) wrote :

Commit hash: a4a8e6ae5426c4d5eb100bc57ebd3d64096f4178
Environment tested: Master
Browser tested: Chrome
Theme used: Raw

PRECONDITIONS:
------------------------
1) Institution One exists
2) 2 Institution admins exist (UserA & UserB)

TEST STEPS:
------------------------
1) Log in as Inst admin UserA
2) Browse to Admin -> Institution -> Files section and upload an image file
3) Edit the file metadata and add a tag 'Cats'
4) User log out and Log in as Inst admin UserB
5) Browse to Admin -> Institution -> Files section
6) Verify that there is no Error message displayed ✔
7) Edit the file metadata
8) Verify that the Tags Field displays the tag 'Cats' ✔

Catalyst QA Approved ✔

Revision history for this message
Steven (stevens-q) wrote :

PRECONDITIONS:
------------------------
1) Group One exists
2) 2 group admins exist (UserA & UserB)

TEST STEPS: Group file tags
------------------------
1) Log in as Group admin UserA
2) Browse to Group One -> Files section and upload an image file
3) Edit the file metadata and add a tag 'Cats'
4) User log out and Log in as Inst admin UserB
5) Browse to Group One -> Files section
6) Verify that there is no Error message displayed ✔
7) Edit the file metadata
8) Verify that the Tags Field displays the tag 'Cats' ✔

Catalyst QA Approved ✔

Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.