Bug 26464 - Code correction in opac-main when news_id passed
Summary: Code correction in opac-main when news_id passed
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-15 12:09 UTC by Marcel de Rooy
Modified: 2020-10-20 01:38 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Manual merge request:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.05


Attachments
Bug 26464: Code correction in opac-main when news_id passed (1.42 KB, patch)
2020-09-15 12:16 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 26464: Code correction in opac-main when news_id passed (1.44 KB, patch)
2020-09-15 19:43 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2020-09-15 12:09:32 UTC
Theoretical change. If somehow the search would return more than one result, the code is wrong.
Comment 1 Marcel de Rooy 2020-09-15 12:16:22 UTC
Created attachment 110105 [details] [review]
Bug 26464: Code correction in opac-main when news_id passed

Theoretical change. If somehow the search would return more than one result, the code is wrong.

The if test can be simplified: remove scalar and >0.
We should not pass @array to one param. It would theoretically add wrong items or
trigger an odd number warning. If it is only one, it is no problem. But it is buggy.

Test plan:
Pass an existing news_id to opac-main. Item visible?
And pass a not-existing. Error message?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2020-09-15 12:16:48 UTC
Trivial. Taking liberty to self sign off.
Comment 3 Katrin Fischer 2020-09-15 19:43:18 UTC
Created attachment 110118 [details] [review]
Bug 26464: Code correction in opac-main when news_id passed

Theoretical change. If somehow the search would return more than one result, the code is wrong.

The if test can be simplified: remove scalar and >0.
We should not pass @array to one param. It would theoretically add wrong items or
trigger an odd number warning. If it is only one, it is no problem. But it is buggy.

Test plan:
Pass an existing news_id to opac-main. Item visible?
And pass a not-existing. Error message?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2020-09-18 09:54:50 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 5 Lucas Gass 2020-10-16 15:05:28 UTC
backported to 20.05.x for 20.05.05
Comment 6 Aleisha Amohia 2020-10-20 01:38:12 UTC
minor trivial fix, not backported to 19.11.x