Bug 37964 - Only show host items when system preference EasyAnalyticalRecords is enabled
Summary: Only show host items when system preference EasyAnalyticalRecords is enabled
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Fridolin Somers
QA Contact: Jonathan Druart
URL:
Keywords: regression
Depends on: 33496
Blocks:
  Show dependency treegraph
 
Reported: 2024-09-19 14:14 UTC by Fridolin Somers
Modified: 2025-01-31 08:54 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06,23.11.11
Circulation function:


Attachments
Bug 37964: Only show host items when system preference EasyAnalyticalRecords is enabled (1.23 KB, patch)
2024-09-19 14:26 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 37964: Add units test (1.56 KB, patch)
2024-09-19 15:00 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 37964: Only show host items when system preference EasyAnalyticalRecords is enabled (1.29 KB, patch)
2024-09-21 15:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37964: Add units test (1.61 KB, patch)
2024-09-21 15:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37964: Only show host items when system preference EasyAnalyticalRecords is enabled (1.36 KB, patch)
2024-09-24 12:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37964: Add units test (1.76 KB, patch)
2024-09-24 12:44 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2024-09-19 14:14:18 UTC
After Bug 33496, host items are displayed even when system preference EasyAnalyticalRecords is disabled.
Comment 1 Fridolin Somers 2024-09-19 14:21:18 UTC
Note that catalogue/detail.pl calls $biblio->items( host_items => 1 ).
But better use the preference inside $biblio->items() like other methods.
Comment 2 Fridolin Somers 2024-09-19 14:26:23 UTC
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
Comment 3 Jonathan Druart 2024-09-19 14:42:19 UTC
Please provide tests.
Comment 4 Fridolin Somers 2024-09-19 15:00:02 UTC
Created attachment 171779 [details] [review]
Bug 37964: Add units test
Comment 5 Lucas Gass (lukeg) 2024-09-21 15:24:23 UTC
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>
Comment 6 Lucas Gass (lukeg) 2024-09-21 15:24:25 UTC
Created attachment 171849 [details] [review]
Bug 37964: Add units test

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Jonathan Druart 2024-09-24 12:37:32 UTC
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.
Comment 8 Jonathan Druart 2024-09-24 12:39:38 UTC
(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.
Comment 9 Jonathan Druart 2024-09-24 12:44:55 UTC
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>
Comment 10 Jonathan Druart 2024-09-24 12:44:58 UTC
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>
Comment 11 Jonathan Druart 2024-09-24 12:45:15 UTC
It feels like there is something better to do here but not finding a solution during the 5min I looked into it.
Comment 12 Martin Renvoize (ashimema) 2024-09-30 14:32:50 UTC
Yeah, I had a nagging feeling too.. but likewise couldn't see anything obvious.
Comment 13 Martin Renvoize (ashimema) 2024-09-30 14:34:23 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 14 Fridolin Somers 2024-10-10 14:39:44 UTC
I rise to major because behavior is quite annoying for librarians.
Please backport :)
Comment 15 Lucas Gass (lukeg) 2024-11-18 22:33:44 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 16 Fridolin Somers 2024-12-11 13:20:50 UTC
Pushed to 23.11.x for 23.11.11