Steps to reproduce: - Set the NewsAuthorDisplay preference to 'OPAC' or 'Both OPAC and staff client.' - Open the OPAC main page and click on an individual news item The page for that single news item shows an error: Template process failed: undef error - The method Koha::NewsItem->author_title is not covered by tests!
This is terrible.
Created attachment 114309 [details] [review] Bug 24398: Fix 500 when viewing a single news item at the OPAC Test plan: 0. Set the NewsAuthorDisplay preference to 'OPAC' or 'Both OPAC and staff client.' 1. Open the OPAC main page and click on an individual news item Without this patch you get an ugly 500 Template process failed: undef error - The method Koha::NewsItem->author_title is not covered by tests! With this patch applied you see the news with the author's info
Created attachment 114312 [details] [review] Bug 24398: Fix 500 when viewing a single news item at the OPAC Test plan: 0. Set the NewsAuthorDisplay preference to 'OPAC' or 'Both OPAC and staff client.' 1. Open the OPAC main page and click on an individual news item Without this patch you get an ugly 500 Template process failed: undef error - The method Koha::NewsItem->author_title is not covered by tests! With this patch applied you see the news with the author's info Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 114398 [details] [review] Bug 24398: Fix 500 when viewing a single news item at the OPAC Test plan: 0. Set the NewsAuthorDisplay preference to 'OPAC' or 'Both OPAC and staff client.' 1. Open the OPAC main page and click on an individual news item Without this patch you get an ugly 500 Template process failed: undef error - The method Koha::NewsItem->author_title is not covered by tests! With this patch applied you see the news with the author's info Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
As a step towards QA, here is another signoff. It even works with an account of an organization. (which only has a name field, but it's actually a surname, so it's normal that it works)
Created attachment 114554 [details] [review] Bug 24398: Fix 500 when viewing a single news item at the OPAC Test plan: 0. Set the NewsAuthorDisplay preference to 'OPAC' or 'Both OPAC and staff client.' 1. Open the OPAC main page and click on an individual news item Without this patch you get an ugly 500 Template process failed: undef error - The method Koha::NewsItem->author_title is not covered by tests! With this patch applied you see the news with the author's info Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 114555 [details] [review] Bug 24398: (QA follow-up) Add POD Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.01
This applies to 20.05.x and appears to work ok, but I'm getting the following error from the QA tools: "Argument "" isn't numeric in numeric gt (>) at /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc line 23." Not backporting, but let me know if needed and I'll chase someone to fix the error
(In reply to Andrew Fuerste-Henry from comment #10) > This applies to 20.05.x and appears to work ok, but I'm getting the > following error from the QA tools: "Argument "" isn't numeric in numeric gt > (>) at > /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc > line 23." > > Not backporting, but let me know if needed and I'll chase someone to fix the > error It's just a (known) warning, you can ignore it.
Pushed to 20.05.x for 20.05.10
Backported: Pushed to 19.11.x branch for 19.11.16