In the top header navigation menu on the Koha OPAC, sets the order of the 'My Lists' dropdown to be sorted alphabetically instead of by modification date.
Created attachment 175497 [details] [review] Bug 38712: order My Lists options alphabetically In the top header navigation menu, sets the order of the 'My Lists' dropdown to be alphabetical. Test plan: - on the Koha OPAC, navigate to /cgi-bin/koha/opac-shelves.pl - create a few public and private lists - open the 'My List' dropdown in the top navigation menu - notice that the lists appear in the order they were created - apply the patch - open the 'My List' dropdown in the top navigation - notice that the lists are now sorted alphabetically
Probably a sensible thing to do.
Created attachment 175583 [details] [review] Bug 38712: Order public and private lists alphabetically In the OPAC top header navigation menu, public and private lists are ordered by the date created, instead of alphabetically. Test plan: 1. On the Koha OPAC, login and navigate to Your account > Lists (/cgi-bin/koha/opac-shelves.pl). 2. Create a few public and private lists. 3. Open the lists dropdown in the top navigation menu. 4. Notice that the lists appear in the order they were created. 5. Apply the patch. 6. Refresh the page and open the lists dropdown in the top navigation. 7. Notice that the lists are now sorted alphabetically. 8. Log out and notice that the lists are now sorted alphabetically.
Hi Chloe. This is a good idea - as it matches how the lists are ordered under Your account > Lists. I amended the patch commit message and was going to sign off. However, I noted that if you log out, you get an error and the OPAC is unusable: Can't use an undefined value as a HASH reference at /kohadevbox/koha/Koha/ Virtualshelves.pm line 200 .... So I've changed the status to Failed QA. David Nind
Created attachment 175596 [details] [review] Bug 38712: order My Lists options alphabetically In the top header navigation menu, sets the order of the 'My Lists' dropdown to be alphabetical. Note: this patch was updated to also handle cases where $params->{search_attributes} is not defined. Test plan: - on the Koha OPAC, navigate to /cgi-bin/koha/opac-shelves.pl - create a few public and private lists - open the 'My List' dropdown in the top navigation menu - notice that the lists appear in the order they were created - apply the patch - open the 'My List' dropdown in the top navigation - notice that the lists are now sorted alphabetically fix: handle undefined search attributes
Hello David, Thank you for the feedback! I have amended the patch accordingly - hopefully this should take care of the issue
(In reply to Chloe Zermatten from comment #6) > Hello David, > > Thank you for the feedback! I have amended the patch accordingly - hopefully > this should take care of the issue Thanks Chloe! I've retested, and that fixes the error. However, if you are logged out, the public lists aren't sorted alphabetically 8-(... David
Created attachment 175643 [details] [review] Bug 38712: order My Lists options alphabetically In the top header navigation menu, sets the order of the 'My Lists' dropdown to be alphabetical. Note: this patch was updated to also handle cases where $params->{search_attributes} is not defined, and also to ensure that it also applies to the list of public lists show to users who are not logged in. Test plan: - on the Koha OPAC, navigate to /cgi-bin/koha/opac-shelves.pl - create a few public and private lists - open the 'My List' dropdown in the top navigation menu - notice that the lists appear in the order they were created - apply the patch - open the 'My List' dropdown in the top navigation - notice that the lists are now sorted alphabetically
Created attachment 175646 [details] [review] Bug 38712: order My Lists options alphabetically In the top header navigation menu, sets the order of the 'My Lists' dropdown to be alphabetical. Note: this patch was updated to also handle cases where $params->{search_attributes} is not defined, and well as ordering public lists when the user is not logged in. Test plan: - on the Koha OPAC, navigate to /cgi-bin/koha/opac-shelves.pl - create a few public and private lists - open the 'My List' dropdown in the top navigation menu - notice that the lists appear in the order they were created - apply the patch - open the 'My List' dropdown in the top navigation - notice that the lists are now sorted alphabetically fix: handle undefined search attributes order list when logged out
Created attachment 175681 [details] [review] Bug 38712: order My Lists options alphabetically In the top header navigation menu, sets the order of the 'My Lists' dropdown to be alphabetical. Note: this patch was updated to also handle cases where $params->{search_attributes} is not defined, and well as ordering public lists when the user is not logged in. Test plan: - on the Koha OPAC, navigate to /cgi-bin/koha/opac-shelves.pl - create a few public and private lists - open the 'My List' dropdown in the top navigation menu - notice that the lists appear in the order they were created - apply the patch - open the 'My List' dropdown in the top navigation - notice that the lists are now sorted alphabetically fix: handle undefined search attributes order list when logged out Signed-off-by: David Nind <david@davidnind.com>
Thanks Chloe! I've added a release note, and changed this to a normal bug, instead of an enhancement. I would suggest formatting the commit message using the commit message guidelines https://wiki.koha-community.org/wiki/Commit_messages, for example: - Sentence case for the bug title - Number the test plan steps (See comment# 3 for how I previously updated the commit message.) Good luck with the QA step! David
Thanks for submitting the bug report and patch, Chloe! For changes to .pm files, we also require unit tests (see https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL17:_Unit_tests_are_required and https://wiki.koha-community.org/wiki/Unit_Tests). It seems odd to me to make a sorting change in pm files instead of at the script or templating level, so you might want to look into that possibility (if you haven't already) before investing time on unit tests. I'm afraid I'm not familiar enough with My Lists or these parts of the code to comment on that with any certainty, though.
Hi Emily and David, Thank you both for the feedback! I will be on leave over the holiday period, so I will pick this back up once I get back.