Bugzilla – Attachment 175583 Details for
Bug 38712
Order My Lists options alphabetically
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38712: Order public and private lists alphabetically
Bug-38712-Order-public-and-private-lists-alphabeti.patch (text/plain), 2.45 KB, created by
David Nind
on 2024-12-16 23:59:03 UTC
(
hide
)
Description:
Bug 38712: Order public and private lists alphabetically
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-12-16 23:59:03 UTC
Size:
2.45 KB
patch
obsolete
>From c8c2d9ad795301c390ed733e123eea56e6822f59 Mon Sep 17 00:00:00 2001 >From: Chloe Zermatten <chloe.zermatten@ptfs-europe.com> >Date: Mon, 16 Dec 2024 11:04:59 +0000 >Subject: [PATCH] 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. >--- > C4/Auth.pm | 2 ++ > Koha/Virtualshelves.pm | 14 +++++++++----- > 2 files changed, 11 insertions(+), 5 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 0ee06104a4..fcc9b6de54 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -333,11 +333,13 @@ sub get_template_and_user { > { > borrowernumber => $borrowernumber, > public => 0, >+ search_attributes => {order_by => { -asc => 'shelfname' }} > } > ); > my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( > { > public => 1, >+ search_attributes => {order_by => { -asc => 'shelfname' }} > } > ); > $template->param( >diff --git a/Koha/Virtualshelves.pm b/Koha/Virtualshelves.pm >index 58653130a4..afc9a8cadc 100644 >--- a/Koha/Virtualshelves.pm >+++ b/Koha/Virtualshelves.pm >@@ -191,16 +191,20 @@ sub get_some_shelves { > }; > } > >+ my $default_search_attributes = { >+ join => [ 'virtualshelfshares' ], >+ distinct => 'shelfnumber', >+ order_by => { -desc => 'lastmodified' }, >+ }; >+ >+ my %search_attributes = (%{$default_search_attributes}, %{$params->{search_attributes}}); >+ > $self->search( > { > public => $public, > ( @conditions ? ( -and => \@conditions ) : () ), > }, >- { >- join => [ 'virtualshelfshares' ], >- distinct => 'shelfnumber', >- order_by => { -desc => 'lastmodified' }, >- } >+ \%search_attributes > ); > } > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38712
:
175497
|
175583
|
175596
|
175643
|
175646
|
175681