Sharing collection with a group not showing on group homepage list

Bug #1655456 reported by Robert Lyon on 2017-01-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Cecilia Vela Gurovic
15.10
High
Unassigned
16.04
High
Unassigned
16.10
High
Unassigned

Bug Description

Sometimes when a user shares a collection with a group they belong to that collection doesn't show in the list for 'Collections shared with this group' in the Group pages block.

The reason for this is because the sql for the list only fetches the collection_view page with displayorder = 0

This is so it fetches the first page so can get the url for collection and also limit the results to once per collection.

The problem occurs when one deletes the first page from a collection via the edit collections views page.

It doesn't reset the collection views display order and so there is no displayorder = 0

A workaround for this could be to change the line in lib/view.php for get_sharedcollections_data()

from
                AND (cv.displayorder = 0 OR cv.displayorder IS NULL)
to
                AND (cv.displayorder = (SELECT MIN(displayorder) FROM collection_view WHERE collection = c.id) OR cv.displayorder IS NULL)

where it fetches the minimum display order value

Or fix up the deletion of views from collection so that the displayorder is reset correctly

Robert Lyon (robertl-9) on 2017-01-10
Changed in mahara:
status: New → Confirmed
importance: Undecided → High
milestone: none → 17.04.0
Robert Lyon (robertl-9) wrote :

It looks like we need to call the Collection->set_viewdisplayorder() function after the Collection->remove_view() one

Or better jet have the call to updating display order within the remove_view() one

Changed in mahara:
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
status: Confirmed → In Progress

for testing

- Create a group with 2 member
- member 1 creates a collection with more than one page
- as member 2, you should see the collection in
  - "shared with me" screen
  - In the group, the collection is in "collections shared with the group" section in About tab
- as member 1, delete first page of collection

expected result:
  member 2 can still see the collection in the screens
actual result:
  Now member 2 can't see the collection in those screens

Mahara Bot (dev-mahara) wrote :

Patch for "15.10_STABLE" branch: https://reviews.mahara.org/7426

Mahara Bot (dev-mahara) wrote :

Patch for "16.04_STABLE" branch: https://reviews.mahara.org/7427

Mahara Bot (dev-mahara) wrote :

Patch for "16.10_STABLE" branch: https://reviews.mahara.org/7428

Reviewed: https://reviews.mahara.org/7411
Committed: https://git.mahara.org/mahara/mahara/commit/359f354007b26e910d3b1e758b33f21182702d01
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 359f354007b26e910d3b1e758b33f21182702d01
Author: Cecilia Vela Gurovic <email address hidden>
Date: Tue Jan 24 11:46:38 2017 +1300

Bug 1655456: fix shared collection not displaying

Collection shared to a group was not displaying
in group page and shared with me page
after first page of collection was deleted.
Fixed by resetting the order when deleting a view.

behatnotneeded

Change-Id: I096114ecf50b7a3af6d1393b387073676a984006

Robert Lyon (robertl-9) on 2017-02-11
Changed in mahara:
status: In Progress → Fix Committed
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/7426
Committed: https://git.mahara.org/mahara/mahara/commit/d6b12ca0910e72944ef499870b390746ff5cba62
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit d6b12ca0910e72944ef499870b390746ff5cba62
Author: Cecilia Vela Gurovic <email address hidden>
Date: Tue Jan 24 11:46:38 2017 +1300

Bug 1655456: fix shared collection not displaying

Collection shared to a group was not displaying
in group page and shared with me page
after first page of collection was deleted.
Fixed by resetting the order when deleting a view.

behatnotneeded

Change-Id: I096114ecf50b7a3af6d1393b387073676a984006

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/7427
Committed: https://git.mahara.org/mahara/mahara/commit/08408a7be7655b39df530cda91207c01c4961fcb
Submitter: Robert Lyon (<email address hidden>)
Branch: 16.04_STABLE

commit 08408a7be7655b39df530cda91207c01c4961fcb
Author: Cecilia Vela Gurovic <email address hidden>
Date: Tue Jan 24 11:46:38 2017 +1300

Bug 1655456: fix shared collection not displaying

Collection shared to a group was not displaying
in group page and shared with me page
after first page of collection was deleted.
Fixed by resetting the order when deleting a view.

behatnotneeded

Change-Id: I096114ecf50b7a3af6d1393b387073676a984006

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/7428
Committed: https://git.mahara.org/mahara/mahara/commit/1a1d193d9542a0dee37ff2ef4db384c4126f2fb8
Submitter: Robert Lyon (<email address hidden>)
Branch: 16.10_STABLE

commit 1a1d193d9542a0dee37ff2ef4db384c4126f2fb8
Author: Cecilia Vela Gurovic <email address hidden>
Date: Tue Jan 24 11:46:38 2017 +1300

Bug 1655456: fix shared collection not displaying

Collection shared to a group was not displaying
in group page and shared with me page
after first page of collection was deleted.
Fixed by resetting the order when deleting a view.

behatnotneeded

Change-Id: I096114ecf50b7a3af6d1393b387073676a984006

Robert Lyon (robertl-9) on 2017-04-27
Changed in mahara:
status: Fix Committed → Fix Released

Reviewed: https://reviews.mahara.org/7455
Committed: https://git.mahara.org/mahara/mahara/commit/3c93b65c9aac53b7c38e14ea85ad9efaec1c4304
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 3c93b65c9aac53b7c38e14ea85ad9efaec1c4304
Author: Niranjan Bandi <email address hidden>
Date: Wed Feb 15 10:19:11 2017 +1300

Bug 1655456: Behat test to check collections shared with group

Testing that sharing a collection with a group shows
on group homepage list

Change-Id: I30c5a2d6fe9dee0016a70416395b8e3abe4b40d5

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers