When you click on the last result of first page or first/last result of following pages of results you get this : Unsupported UNIMARC character encoding [] for XML output for UNIMARC; 100$a -> at /usr/share/perl5/MARC/File/XML.pm line 505. This happens because of the following patch : "bug_6488 followup - fixes issue with bibs with no items and serials being suppressed". + if ($items_count > 0) { next if $is_opac && $hideatopac_count >= $items_count; next if $hidelostitems && $itemlost_count >= $items_count; - + } When commented the 2 conditions lines that have been added, the records display correctly again. Strangely, this patch seems not to have been validated (cf comments thread in Bug 6488). But may be, I missed something...
Created attachment 11446 [details] [review] Proposed patch Very small patch for a big bug. Some have this error message : Software error: Can't call method "data" on an undefined value at /home/kokha/src/C4/Search.pm line 1505. The problem appears in the 'searchAgain' function in opac-detail.pl. This function is called only on a detail page that is at the end or the begining of a result page. So : In opac-detail.pl, in searchResults method call : The zebra results are used in a hash instead of an array (see opac-results.pl). + The parameter giving hidelostitems syspref is useless, this syspref is managed into method. Please test and signoff.
I can't reproduce this error Here's what I did Search for fish Click on the 20th result .. no error Click on to page 2 Click on the first result ... no error What am I doing wrong?
The fix for this was pushed several months ago.
No wonder I can't recreate this, were you testing on master Fridolyn ?
I'm up to date on master : v3.09.00.030. I forgot to say you must activate 'OpacBrowseResults' syspref. I user Koha sandbox n°2 database. @Jared Camins-Esakov : Do you know which bug/commit ?
Seems linked to Bug 7894 / commit d13f5780dfeb062a9c677043b89f82d7d7a60b3a
In my opinion, the bug can be explained by looking at the actual code (v3.09.00.030): In opac-details.pl, the searchAgain method contains : my @records = $results_hashref->{$server}->{"RECORDS"}; @newresults = searchResults('opac', '', $hits, $results_per_page, $offset, $arrParamsBusc->{'scan'}, \@records,, C4::Context->preference('hidelostitems')); But, in opac-search.pl there is : @newresults = searchResults('opac', $query_desc, $hits, $results_per_page, $offset, $scan, $results_hashref->{$server}->{"RECORDS"}); In both, $results_hashref comes from C4::Search::getRecords. In this method, search results are added to the results of a server by : $results_hash->{'RECORDS'}[$j] = $record; So the hash entry $results_hash->{'RECORDS'} contains a ref to an array of records. Therefore, my patch proposes to use in opac-details.pl/searchAgain the same syntax as in opac-search.pl where it works fine. Test : ------ You can reproduce the bug by using Sandbox n°2 (check that OpacBrowseResults syspref is on) : http://wiki.koha-community.org/wiki/Sandboxes. Perform a search with more than 20 results and click on first result of second page. I think it corrects the bug 7894 which is not fully corrected : see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7894#c7
Created attachment 11787 [details] [review] Bug 8293: Software error when clicking on first or last result of each page on OPAC Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
The proposed patch fixes the problem for me. - Enable the OpacBrowseResults - launch a search with more than 20 results - click on page 2 - click on the first result - boum ... SearchResult wants 7 arguments, 8 are given with the current code, so the last one is useless.
Created attachment 11790 [details] [review] Bug 8293: Replace IFNULL with COALESCE mysql> SELECT IFNULL(0, 123); +----------------+ | IFNULL(0, 123) | +----------------+ | 0 | +----------------+ 1 row in set (0.00 sec) mysql> SELECT IFNULL(1, 123); +----------------+ | IFNULL(1, 123) | +----------------+ | 1 | +----------------+ 1 row in set (0.00 sec) mysql> SELECT IFNULL(NULL, 123); +-------------------+ | IFNULL(NULL, 123) | +-------------------+ | 123 | +-------------------+ 1 row in set (0.00 sec) mysql> SELECT COALESCE(0, 123); +------------------+ | COALESCE(0, 123) | +------------------+ | 0 | +------------------+ 1 row in set (0.00 sec) mysql> SELECT COALESCE(1, 123); +------------------+ | COALESCE(1, 123) | +------------------+ | 1 | +------------------+ 1 row in set (0.00 sec) mysql> SELECT COALESCE(NULL, 123); +---------------------+ | COALESCE(NULL, 123) | +---------------------+ | 123 | +---------------------+ 1 row in set (0.00 sec)
Comment on attachment 11790 [details] [review] Bug 8293: Replace IFNULL with COALESCE Oups, wrong bug !
(In reply to comment #8) > Created attachment 11787 [details] [review] > Bug 8293: Software error when clicking on first or last result of each page > on OPAC > > Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> passing QA on this... $ koha-qa.pl -v 2 testing 1 commit(s) (applied to commit ba98cb9) * ec365ff Bug 8293: Software error when clicking on first or last result of each page on OPAC opac/opac-detail.pl - perlcritic-progressive tests... OK - perl -c syntax tests... OK - xt/tt_valid.t tests... OK - xt/author/valid-template.t tests... OK - t/00-valid-xml.t tests... OK
This bug fixes an obvious API call and also fixes the problem. Although the message can seem to be UNIMARC related, it is not (and I haven't the same message on my setup). Patch pushed
Pushed to 3.8.x, will be in 3.8.5 I also pushed a follow up to update the POD so people won't read that and be confused. I will attach that patch here for sign off and inclusion in master.
Created attachment 11934 [details] [review] Bug 8293 : Fixing POD to match actuality.
Created attachment 11946 [details] [review] Bug 8293 Fixing POD to match actuality Signed off (Just a comment change)
Last patch passes QA (FIX POD)
Follow-up pushed, everything in master & stable if i'm not mistaking, setting status accordingly