]> 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)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 8 Mar 2021 14:15:48 +0000 (15:15 +0100)
commitca4ef19a2bb400d4348ee84eaddf6af0c429d1c7
tree0e376c7e0966c5e76353d1b4e8619a36b77f3a52
parente5a44214eb9ceb4646f23dd6962bcdc85e58d5b8
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>
opac/opac-main.pl