[Koha-bugs] [Bug 24745] OPAC news block plugin should evaluate as false if there are no items

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 4 20:15:28 CET 2020


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

Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> changed:

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

--- Comment #5 from Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> ---
Created attachment 100152
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100152&action=edit
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 at gmail.com>
Divs gone, no errors.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list