Institution blog pagination broken when you first visit the Institution Journals page

Bug #1520067 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Aaron Wells
15.10
Fix Released
Medium
Aaron Wells

Bug Description

This patch ( https://reviews.mahara.org/#/c/5784/3 ) fixes institution blog pagination. But! When you first go to the Administration -> Institutions -> Journals, pagination is still broken. This is because on first loading the page, we have the query param "institution=1". The artefact/blog/index.php page passes this to institution_selector_for_page(), which understands "1" to mean "show me the default first institution".

But, the paginator JS automatically also takes this "1" from the query and passes it to the paginator script artefact/blog/index.json.php. And that script doesn't know what to do with it, so it crashes and says "A required parameter is missing or malformed The 'institution' parameter is not alphabetical only".

Revision history for this message
Aaron Wells (u-aaronw) wrote :

To replicate:

1. Install Mahara
2. Create a new institution
3. Go to Administration -> Institutions -> Journals
4. Create more than 10 journals for your new institution
5. Again click the "Administration -> Institution -> Journals" link in the menu (so that you again get the starting "institution=1" URL)
6. Try to use pagination to see the rest of your journals

Expected result: You paginate to the second page of journals for the institution
Actual result: Pagination fails, and you see an error message about institution not being entirely alphabetic

This probably got overlooked during testing, because if you have just created a journal in an institution, then you get returned to the Journals page with the institution's name in the URL. It's only when you click the "Administration -> Institution -> Journals" link that you see the "1" in the URL.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Medium priority, because you have to be using institution journals, and have more than 10 of them, for this to be an issue. Not 10 institution journal entries, but 10 institution *journals*. Probably a relatively rare use-case.

Also, there is a workaround. Create a second institution, and then after you're on the Institution Journals page, use the institution menu to go to the second institution, then back to the first institution. This will prime the URL with the institution's real name instead of "1".

summary: - Institution blog pagination broken in sites with only 1 institution
+ Institution blog pagination broken when you first visit the Institution
+ Journals page
description: updated
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/5787

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

The patch can break things if there are no institutions yet created and you try and go to the Institution -> Journals page.

I've updated the patch to deal with that issue

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

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

commit c2d60a960cef3ac428e8b7063f279e8ae27fffc3
Author: Aaron Wells <email address hidden>
Date: Thu Nov 26 18:24:41 2015 +1300

Reload institution blogs page to get institution's real name

Bug 1520067

behatnotneeded

Change-Id: Ib5943225f48fbacc96986397eb34b94c9db4047b

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

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

Aaron Wells (u-aaronw)
tags: added: admin institutions journals
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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

commit a9b7e9b3864d9d71cc56ba3f2ca46f5d16339b91
Author: Aaron Wells <email address hidden>
Date: Thu Nov 26 18:24:41 2015 +1300

Reload institution blogs page to get institution's real name

Bug 1520067

behatnotneeded

Change-Id: Ib5943225f48fbacc96986397eb34b94c9db4047b
(cherry picked from commit c2d60a960cef3ac428e8b7063f279e8ae27fffc3)

no longer affects: mahara/16.04
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.