Bugzilla – Attachment 57104 Details for
Bug 17526
OPAC lists sortfield breaks with a `(`
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17526 - OPAC lists require a sortfield
Bug-17526---OPAC-lists-require-a-sortfield.patch (text/plain), 1.97 KB, created by
Marc Véron
on 2016-11-02 14:25:19 UTC
(
hide
)
Description:
Bug 17526 - OPAC lists require a sortfield
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-11-02 14:25:19 UTC
Size:
1.97 KB
patch
obsolete
>From 8d36002fd6d4a730ef0fcb7b881fbde1bc710a9c Mon Sep 17 00:00:00 2001 >From: Blou <philippe.blouin@inlibro.com> >Date: Mon, 31 Oct 2016 15:42:30 -0400 >Subject: [PATCH] Bug 17526 - OPAC lists require a sortfield >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Using the OPAC, going into the public lists, we click one of them and get > >DBIx::Class::Storage::DBI::_dbh_execute(): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC LIMIT 10) `me` JOIN `biblio` `biblionumber` ON `biblionumber`.`biblionumber' > >THis is because the sortfield is empty and creates a SQL like GROUP BY ASC LIMIT 10. Missing the group by <what?>. >In the intranet list, there's a default usage of 'title' that makes it all work. > >TESTING: >1) just create a public list with no sortfield. In the DB: > - virtualshelves.category = 2 > - virtualshelves.sortfield = '' >2) click on the list in the OPAC's public list. Boom! > >This simple patch uses 'title' if nothing else is specified. > >Reproduced. Patch fixes issue as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > opac/opac-shelves.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index b29ade6..ba79d52 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -225,7 +225,7 @@ if ( $op eq 'view' ) { > if ( $shelf ) { > if ( $shelf->can_be_viewed( $loggedinuser ) ) { > $category = $shelf->category; >- my $sortfield = $query->param('sortfield') || $shelf->sortfield; # Passed in sorting overrides default sorting >+ my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting > my $direction = $query->param('direction') || 'asc'; > $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; > my ( $page, $rows ); >-- >2.1.4
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 17526
:
57010
|
57104
|
90584
|
90641
|
90695