After Bug 33496, host items are displayed even when system preference EasyAnalyticalRecords is disabled.
Note that catalogue/detail.pl calls $biblio->items( host_items => 1 ). But better use the preference inside $biblio->items() like other methods.
Created attachment 171776 [details] [review] Bug 37964: Only show host items when system preference EasyAnalyticalRecords is enabled After Bug 33496, host items are displayed even when system preference EasyAnalyticalRecords is disabled. Test plan : 1) Build an analytical record with 773$0 and $9 2) Enable 'EasyAnalyticalRecords' 3) Go to catalogue details page => You see the linked item 4) Disable EasyAnalyticalRecords 5) Go to catalogue details page => You dont see the linked item
Please provide tests.
Created attachment 171779 [details] [review] Bug 37964: Add units test
Created attachment 171848 [details] [review] Bug 37964: Only show host items when system preference EasyAnalyticalRecords is enabled After Bug 33496, host items are displayed even when system preference EasyAnalyticalRecords is disabled. Test plan : 1) Build an analytical record with 773$0 and $9 2) Enable 'EasyAnalyticalRecords' 3) Go to catalogue details page => You see the linked item 4) Disable EasyAnalyticalRecords 5) Go to catalogue details page => You dont see the linked item Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 171849 [details] [review] Bug 37964: Add units test Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
I've looked at the code, and it's actually confusing to have both ->items and ->host_items. $biblio->items should return $self->host_items when host_items is passed OR we replace the occurrences when ->items is called with the host_items flag to simply call ->host_items. I think I prefer the latter.
(In reply to Jonathan Druart from comment #7) > I've looked at the code, and it's actually confusing to have both ->items > and ->host_items. > > $biblio->items should return $self->host_items when host_items is passed OR > we replace the occurrences when ->items is called with the host_items flag > to simply call ->host_items. I think I prefer the latter. Ok, forget that. It includes both.
Created attachment 171926 [details] [review] Bug 37964: Only show host items when system preference EasyAnalyticalRecords is enabled After Bug 33496, host items are displayed even when system preference EasyAnalyticalRecords is disabled. Test plan : 1) Build an analytical record with 773$0 and $9 2) Enable 'EasyAnalyticalRecords' 3) Go to catalogue details page => You see the linked item 4) Disable EasyAnalyticalRecords 5) Go to catalogue details page => You dont see the linked item Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 171927 [details] [review] Bug 37964: Add units test Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Amended-by: Jonathan Druart Tidy Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
It feels like there is something better to do here but not finding a solution during the 5min I looked into it.
Yeah, I had a nagging feeling too.. but likewise couldn't see anything obvious.
Thanks for all the hard work! Pushed to main for the next 24.11.00 release as RM Assistant
I rise to major because behavior is quite annoying for librarians. Please backport :)
Backported to 24.05.x for upcoming 24.05.06
Pushed to 23.11.x for 23.11.11