---- Reported by jeanandre.santoni@biblibre.com 2009-08-25 08:18:10 ---- In addbook.pl, the framwork options are sorted in random order. They should be sorted in alphabetical order of value or code. ---- Additional Comments From jeanandre.santoni@biblibre.com 2009-08-25 08:27:00 ---- Created an attachment bugfix --- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:12 UTC --- This bug was previously known as _bug_ 3549 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3549 Imported an attachment (id=1407) Actual time not defined. Setting to 0.0 The original reporter of this bug does not have an account here. Reassigning to the person who moved it here: chris@bigballofwax.co.nz. Previous reporter was jeanandre.santoni@biblibre.com. The original assignee of this bug does not have an account here. Reassigning to the default assignee for the component, gmcharlt@gmail.com. Previous assignee was jeanandre.santoni@biblibre.com. Bug reassigned, setting status to "NEW". Previous status was "ASSIGNED". The original submitter of attachment 1407 [details] [review] is unknown. Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
This is in master, please test
The original patch changes this: foreach my $thisframeworkcode ( keys %$frameworks ) { to this: foreach my $thisframeworkcode ( sort keys %$frameworks ) { ...which worka to have the framework list sorted by framework code, but since the description is what is displayed sorting by code doesn't make much sense. The actual commit made this change: foreach my $thisframeworkcode ( sort {$frameworks->{$a} cmp $frameworks->{$b}}keys %{$frameworks} ) { ...but this doesn't seem to work at all. Sorting appears random to me.
Comment on attachment 1407 [details] [review] bugfix 3.0.x is no longer maintained. Marking bug obsolete.
*** Bug 5469 has been marked as a duplicate of this bug. ***
Created attachment 15592 [details] [review] Bug 3549 - Framework sorting in addbook Reviewing Bug 9649, this bug comes up. This patch correctly sort frameworks by description. To test: 1) Go to Cataloguing home, button 'New record' shows unordered list of frameworks 2) Apply the patch 3) refresh, the list must be correctly sorted.
Created attachment 15594 [details] [review] [SIGNED-OFF] Bug 3549 - Framework sorting in addbook Reviewing Bug 9649, this bug comes up. This patch correctly sort frameworks by description. To test: 1) Go to Cataloguing home, button 'New record' shows unordered list of frameworks 2) Apply the patch 3) refresh, the list must be correctly sorted. Signed-off-by: Owen Leonard <oleonard@myacpl.org>
QA comment: This patch changes the order only for 1 page. It is easy to change the sort order for all pages changing the sql query in C4::Koha::getframeworks Marked as Failed QA.
Forget that, the routine returns a hashref! However the sort order is not case insensitive (uppercases are sorted before lowercase).
Created attachment 15761 [details] [review] Bug 3549 -[Revised]- Framework sorting in addbook Reviewing Bug 9649, this bug comes up. This patch correctly sort frameworks by description. To test: 1) Go to Cataloguing home, button 'New record' shows unordered list of frameworks 2) Apply the patch 3) refresh, the list must be correctly sorted. Revised to sort using uppercase. Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Silly mistake. Fixed
Thanks Bernardo. Simple patch, it sorts framework by description. I am convinced that a rewrite of C4::Koha::getframeworks would be a good thing. It would return a arrayref (instead of a hashref) with a sorted frameworks list. But it is a bigger patch than this one. Marked as Passed QA.
Created attachment 15762 [details] [review] Bug 3549 -[Revised]- Framework sorting in addbook Reviewing Bug 9649, this bug comes up. This patch correctly sort frameworks by description. To test: 1) Go to Cataloguing home, button 'New record' shows unordered list of frameworks 2) Apply the patch 3) refresh, the list must be correctly sorted. Revised to sort using uppercase. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This patch has been pushed to master.
I don't see that as an enhancement. Should be a bugfix. M. Saby