]> git.koha-community.org Git - koha.git/commit
Bug 27650: Fix variable passed to the template in opac-main
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 10 Feb 2021 06:26:15 +0000 (07:26 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 12 Mar 2021 08:03:16 +0000 (09:03 +0100)
commitaf888cd3b84d0b784667dca4d16a00a3c19c3516
tree20729341d9cdfd1ad10ec4e3c68dd24bb1f7954e
parent4b6e421f1f40bd99cba0c380510824f4a45894cd
Bug 27650: Fix variable passed to the template in opac-main

$template->param(
+    koha_news           => @all_koha_news,

We must not pass an array, the number of elements of the hash passed to the template may be inconsistent.

It's working because of an error earlier in the script:
+    @all_koha_news   = &GetNewsToDisplay($news_lang,$homebranch);

GetNewsToDisplay returns an arrayref

Test plan:
Define at least 2 news to display on the OPAC main page
Hit opac-main.pl
=> All news are displayed
Click one
=> You see the single news you selected

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ca4ef19a2bb400d4348ee84eaddf6af0c429d1c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
opac/opac-main.pl