Bug 29691 - Use template plugins to display opac news on homepage
Summary: Use template plugins to display opac news on homepage
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on: 28955
Blocks:
  Show dependency treegraph
 
Reported: 2021-12-14 13:35 UTC by Nick Clemens
Modified: 2023-01-25 10:53 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 29691: Use template to display news on opac homepage (10.38 KB, patch)
2021-12-14 13:40 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29691: Use template to display news on opac homepage (10.44 KB, patch)
2021-12-14 13:51 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-12-14 13:35:41 UTC
Currently the news for display are fetched in the script, if we move this to the template, bug 28955 will allow displaying branch news by default on home page
Comment 1 Nick Clemens 2021-12-14 13:40:04 UTC
Created attachment 128506 [details] [review]
Bug 29691: Use template to display news on opac homepage

This patch moves the fetching of news to the template and
adds a p[lugin method to get news by id

TO test:
1 - Define some general and library specific news items
2 - Define in various languages
3 - Define some 'Additional contents' as well
4 - Apply patch
5 - Confirm onlly 'all libraries' news show if not loigged in to opac
6 - Confirm correct library news show when logged in
7 - View specific news items:
    http://localhost:8080/cgi-bin/koha/opac-main.pl?news_id=12
8 - Confirm that non-existent ids show " This news item does not exist. "
9 - Confirm if you enter ID for additional contents you get 'does not exist'
Comment 2 Martin Renvoize 2021-12-14 13:51:53 UTC
Created attachment 128508 [details] [review]
Bug 29691: Use template to display news on opac homepage

This patch moves the fetching of news to the template and
adds a p[lugin method to get news by id

TO test:
1 - Define some general and library specific news items
2 - Define in various languages
3 - Define some 'Additional contents' as well
4 - Apply patch
5 - Confirm onlly 'all libraries' news show if not loigged in to opac
6 - Confirm correct library news show when logged in
7 - View specific news items:
    http://localhost:8080/cgi-bin/koha/opac-main.pl?news_id=12
8 - Confirm that non-existent ids show " This news item does not exist. "
9 - Confirm if you enter ID for additional contents you get 'does not exist'

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2021-12-14 13:52:43 UTC
Nice work Nick.. signing off :)
Comment 4 Jonathan Druart 2022-01-19 12:42:06 UTC
Missing POD and tests.
Comment 5 Jonathan Druart 2022-01-19 12:50:33 UTC
113                             [% IF ( news_item ) %]
114                                 &bull; <a href="/cgi-bin/koha/opac-main.pl">Show all news</a>
115                             [% END %]

This is not displayed.
Comment 6 Jonathan Druart 2022-01-19 12:51:44 UTC
The news is not displayed in the translated version of the interface (does not seem related to this patch however).
Comment 7 Martin Renvoize 2022-07-13 06:57:25 UTC
Do you intend to revisit this Nick?