https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42576 Bug ID: 42576 Summary: get_components_query excludes bib-level 'd' (subunit) from analytics search Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org When UseControlNumber is enabled, get_components_query in Koha::Biblio filters analytics with: AND (bib-level:a OR bib-level:b) This excludes records with LDR/07 = 'd' (subunit), which is a valid MARC21 bibliographic level for dependent parts of a multipart item (e.g., individual episodes of a video series). The same limitation exists in the XSLT 'Show analytics' link (MARC21slim2intranetDetail.xsl and MARC21slim2OPACDetail.xsl). **To reproduce:** 1. Enable UseControlNumber 2. Create a host record with 001 3. Create an analytic record with 773$w pointing to the host's 001 4. Set the analytic's LDR/07 to 'd' (subunit) 5. View the host record detail page 6. Observe that 'Show analytics' does not find the analytic **Expected behavior:** Records with bib-level 'd' should be included in the analytics search, as 'd' (subunit) is semantically equivalent to 'a' (monographic component part) and 'b' (serial component part) for the purpose of identifying dependent parts. **Proposed fix:** Change the filter in get_components_query (Koha/Biblio.pm) and the XSLT templates from: (bib-level:a OR bib-level:b) to: (bib-level:a OR bib-level:b OR bib-level:d) Affected code locations: - Koha/Biblio.pm line ~953 (get_components_query) - Koha/Biblio.pm line ~1048 (get_volumes_query, NOT filter) - koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl (Show analytics link) - koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl (Show analytics link) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.