Bug 24745: OPAC news block plugin should evaluate as false if there are no items
commitb1523255a8c53d50175ac55f94330995663e6937
authorOwen Leonard <oleonard@myacpl.org>
Thu, 27 Feb 2020 01:31:37 +0000 (27 01:31 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 25 Mar 2020 09:41:58 +0000 (25 09:41 +0000)
tree4d8a3eb0693b8fa2de9527c03f4b6e95fa22a694
parent18ad5f5eea8aab8414783f4b75408cfebd2518da
Bug 24745: OPAC news block plugin should evaluate as false if there are no items

This patch changes the way news is returned from GetNewsToDisplay in
KohaNews.pm so that the template variable will evaluate as false instead
of simply being an empty data structure.

To verify the bug, remove your opacheader news entry and view source on
any page in the OPAC. You should find some empty markup right after
'</div> <!-- /navbar -->'

<div class="container-fluid">
    <div class="row-fluid">
    </div>
</div>

To test the fix, apply the patch and reload the OPAC page. The empty
divs should be gone. Add content to the opacheader news item and confirm
that it displays correctly.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Template/Plugin/KohaNews.pm