Summary: | default sort field and order when syspref are NULL | ||
---|---|---|---|
Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
Component: | System Administration | Assignee: | Fridolin Somers <fridolin.somers> |
Status: | CLOSED FIXED | QA Contact: | Bugs List <koha-bugs> |
Severity: | normal | ||
Priority: | PATCH-Sent (DO NOT USE) | CC: | chris, gmcharlt |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8012 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Proposed patch
BUG6092 default sort field and order when syspref are NULL |
Description
Fridolin Somers
2011-04-06 14:42:09 UTC
Created attachment 3750 [details] [review] Proposed patch Created attachment 4139 [details] [review] BUG6092 default sort field and order when syspref are NULL Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> (In reply to comment #2) > Created attachment 4139 [details] [review] > BUG6092 default sort field and order when syspref are NULL > > Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Hie, Is the first patch obsolete ? I bet yes. QA comment
This patch does not apply anymore. I think it must be completly rewritten. The conflict says :
<<<<<<< HEAD
if ( C4::Context->preference('OPACdefaultSortField')
&& C4::Context->preference('OPACdefaultSortOrder') ) {
my $default_sort_by =
C4::Context->preference('defaultSortField') . '_'
. C4::Context->preference('defaultSortOrder');
$template->param( $default_sort_by => 1 );
}
=======
$template->param($default_sort_by => 1);
>>>>>>> BUG6092 default sort field and order when syspref are NULL
=> the default sort order is set only if the syspref have been set, so the
my $default_sort_field = C4::Context->preference('defaultSortField') || 'relevance'; # relevance field by default
my $default_sort_order = C4::Context->preference('defaultSortOrder') || 'dsc'; # decreasing order by default
my $default_sort_by = $default_sort_field.'_'.$default_sort_order;
will do nothing.
I think this still needs a fix: 157 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); 158 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); Fridolyn, could you perhaps resubmit this patch with changes to the syspref.sql file? Fixed by another patch |