Bug 40798 - Only show component parts if leader tells us to
Summary: Only show component parts if leader tells us to
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-12 09:55 UTC by Magnus Enger
Modified: 2025-09-12 11:43 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2025-09-12 09:55:12 UTC
Looking at this code from catalogue/detail.pl:

# Get component parts details
my $showcomp = C4::Context->preference('ShowComponentRecords');
my $show_analytics;
if ( $showcomp eq 'both' || $showcomp eq 'staff' ) {
    if ( my $components =
        !$invalid_marc_record ? $biblio->get_marc_components( C4::Context->preference('MaxComponentRecords') ) : undef )
    {
        $show_analytics = 1 if @{$components};    # just show link when having results

https://git.koha-community.org/Koha-community/Koha/src/branch/main/catalogue/detail.pl#L243

It looks like we only check if ShowComponentRecords is enabled before we show component parts. But should we not check the leader to see if this is a record that should have components in the first place? 

These pages from the wiki seem to indicate that the leader plays a role in determining this:
https://wiki.koha-community.org/wiki/Serial_Analytics
https://wiki.koha-community.org/wiki/Sets_with_Volumes

I moght be missing something here, please correct me if I'm wrong! :-)
Comment 1 Katrin Fischer 2025-09-12 11:09:02 UTC
I think a lot of different records can have components, so not sure if we can further limit it. Serials and monographs could have components, analytical recors might not have components themselves... but I am not sure if that is actually not a thing, you could probably catalog it.

You cannot tell from the MARC if a record actually has components, so might as well check.
Comment 2 Magnus Enger 2025-09-12 11:43:19 UTC
For a moment I thougt a monograph would never have parts, but then there are chapters, og course... Closing this.