expired shared pages still display in groups

Bug #1437929 reported by Jawyei Wong
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

When a page is shared with a group it appears in Group Pages->Pages shared with this group. If the page has a time restriction, it will still show in Pages shared with this group even if the end date has expired or if the start date is has not begun. The permission are correct in that if a user who does not have permission to view the page outside of the time restriction tries to access it, they cannot access the page.

It would be better if Pages shared with this group only lists pages that is accessible to group. This can be done by altering line 3997 in ./lib/view.php in function get_sharedviews_data($limit=10, $offset=0, $groupid) from

WHERE a.group = ? AND m.member = ? AND (v.group IS NULL OR v.group != ?);

to

WHERE a.group = ? AND m.member = ? AND (v.group IS NULL OR v.group != ?) AND (a.startdate <= current_timestamp OR a.startdate IS NULL) AND (a.stopdate > current_timestamp OR a.stopdate IS NULL)';

Checked on version 1.8 and 1.10.

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/4522

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Jawyei,

Thank you for you bug report and fix. You are correct in that the pages shouldn't be listed there if they are outside the access time.

I've added your fix to the review tracker: https://reviews.mahara.org/#/c/4522/

Cheers

Robert

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

Reviewed: https://reviews.mahara.org/4522
Committed: http://gitorious.org/mahara/mahara/commit/94e25ce5edf709c0785be6268d7ed86a6cee327d
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 94e25ce5edf709c0785be6268d7ed86a6cee327d
Author: Robert Lyon <email address hidden>
Date: Mon Mar 30 12:53:40 2015 +1300

Stopping display of pages in shared to group if outside access time

Bug 1437929

If a page that is shared to a group has their stop date before current
time or start date in the future don't display them on group homepage
in the "Pages shared with this group" section.

Change-Id: Idc605047184e2b8e04ef2b6c17e53f469ac8cd2f
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 "15.04_STABLE" branch: https://reviews.mahara.org/4565

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

Reviewed: https://reviews.mahara.org/4565
Committed: http://gitorious.org/mahara/mahara/commit/89ff4c917e20f3155f430e1130897d51be8843b7
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit 89ff4c917e20f3155f430e1130897d51be8843b7
Author: Robert Lyon <email address hidden>
Date: Mon Mar 30 12:53:40 2015 +1300

Stopping display of pages in shared to group if outside access time

Bug 1437929

If a page that is shared to a group has their stop date before current
time or start date in the future don't display them on group homepage
in the "Pages shared with this group" section.

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

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
Revision history for this message
Jawyei Wong (jawyei-wong) wrote :

I'm just wondering if this particular method is best as I have noticed that the row entry is still there in the view_access table. It is only after you go back into edit access of the page and click submit does that remove that row. Would removing the row be better than having it potentially sit in that table forever?

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Jawyei,

Yes the view_access row needs to stay as the page is still expired.

If we delete the view access row (like via a cron job) then the user would get confused as to why the view access option they set has disappeared so we want the row to stay forever (or until the user edits it otherwise).

Cheers

Robert

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.