]> 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)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Sun, 14 Mar 2021 19:56:32 +0000 (19:56 +0000)
commitfbc96a7d31cf7d98ea3827c68f47980f961411d9
tree7db61eef418acd4c27afffbec40dfd60d505e2cc
parent632f4600e0d80c27366aa4af603f709f5ada3fe8
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>
(cherry picked from commit af888cd3b84d0b784667dca4d16a00a3c19c3516)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
opac/opac-main.pl