https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40861

Marcel de Rooy <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #186810|0                           |1
        is obsolete|                            |

--- Comment #6 from Marcel de Rooy <[email protected]> ---
Created attachment 186811
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186811&action=edit
Bug 40861: Remove warning from serials/acqui-search-result.pl

Odd number of elements in anonymous hash at
/kohadevbox/koha/serials/acqui-search-result.pl line 84.

it's coming from closedate that is empty, and output_pref that will
reach this return:
278     if ($str) {
279         local $@;
280         $dt = eval { dt_from_string($str) };
281         Koha::Exceptions::WrongParameter->throw("Invalid date '$str' passed
to output_pref") if $@;
282     }
283
284     return if !defined $dt;    # NULL date

if str is undef, we don't enter if l.278 and return l.284
which will shift the elements of the hash (because of the list context)

We force the scalar and we are good.

There was no side-effect because closedate was the last of the list.

Note that total (and the 'count(*)' key) is not used in the template.

Test plan:
Create an order for a basket of the first vendor "My vendor" and hit
http://localhost:8081/cgi-bin/koha/serials/acqui-search-result.pl?supplier=d
Without this patch you get the warning
Odd number of elements in anonymous hash at
/kohadevbox/koha/serials/acqui-search-result.pl line 84.

Signed-off-by: Marcel de Rooy <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to