Bug 31608 - ShowComponentRecords doesn't display components if UseControlNumber is turned on
Summary: ShowComponentRecords doesn't display components if UseControlNumber is turned on
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 11175
Blocks:
  Show dependency treegraph
 
Reported: 2022-09-22 19:54 UTC by Caroline Cyr La Rose
Modified: 2024-04-01 14:13 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2022-09-22 19:54:06 UTC
I apologize if this is a duplicate. 

I'm trying to document the new Components feature, but I'm running into problems when using UseControlNumber. In Bug 30327, the test plan mentions that UseControlNumber can be used or not, but from what I can see, ShowComponentRecords does not work with UseControlNumber.

To test:
1. Enable ShowComponentRecords
1.1. Go to Administration > Global system preferences
1.2. Search for ShowComponentRecords
1.3. Choose either staff interface or both
1.4. Save

2. Enable UseControlNumber
2.1. Go to Administration > Global system preferences
2.2. Search for UseControlNumber
2.3. Choose 'Use'
2.4. Save

3. Add 773 $t and $w in the default MARC bibliographic framework
3.1. Go to Administration > MARC bibliographic framework  
3.2. Click Actions > MARC structure next to Default framework
3.3. Search for 773
3.4. Click Actions > Edit subfields
3.5. Click on tab 't'
3.6. Check 'Editor' in the 'Advanced constraints' section
3.7. Click on tab 'w'
3.8. Check 'Editor' in the 'Advanced constraints' section

4. Catalog a host record
4.1. Go to Cataloging 
4.2. Click on 'New record'
4.3. Fill in the mandatory fields (000, 003, 005, 008, 040$c, 245$a (note this one down), 942$c)
4.4. Enter a number in 001 (and note it down)
4.5. Save
(no need to create an item)

5. Catalog a child record
5.1. Go to Cataloging 
5.2. Click on 'New record'
5.3. Fill in the mandatory fields (000, 003, 005, 008, 040$c, 245$a, 942$c)
5.4. Fill in 773$a with the title (245$a) of the host record
5.5. Fill in 773$w with the control number (001) of the host record
5.6. Save
(no need to create an item)

6. If necessary, reindex
7. Go to the host record
   --> The child record doesn't appear
8. Change UseControlNumber back to Don't use (steps 2)
   --> The child record appears
Comment 1 Katrin Fischer 2022-09-23 14:04:15 UTC
Hi Caroline, same issue with Elasticsearch/Zebra?
Comment 2 Caroline Cyr La Rose 2022-09-23 14:46:16 UTC
(In reply to Katrin Fischer from comment #1)
> Hi Caroline, same issue with Elasticsearch/Zebra?

I did this with ES on my local installation and with Zebra on a BW sandbox.
Comment 3 Katrin Fischer 2022-11-16 23:10:35 UTC
Hi Caroline, do you still happen to know were you were testing? If it was an updated installation, the cnr index might have been missing as it's not added on update for Elasticsearch.
Comment 4 Magnus Enger 2023-11-20 12:45:10 UTC
So the question then is perhaps if this was never implemented with UseControlNumber, or if it was implemented and some bug snuck in and made it not work any more? 

In t/db_dependent/Koha/Biblio.t there is a set of subtests labeled "get_components_query", which seems to be testing with UseControlNumber both off and on. And the tests pass. 

The original bug 11175 has this patch: 
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=126882
"Taking the code in bug 15851 as inspiration this patch also adds proper
handling for UseControlNumber vs EasyAnalytics style 773 linking and
ensures we only return analytic component parts and no other records
containing 773's."

Sounds to me like it should work. I'm changing this from "enh" to "normal bug".
Comment 5 Katrin Fischer 2024-04-01 14:13:22 UTC
It should work if a library is using control-numbers for linking, I am pretty sure I tested this.
Needs some more testing I think to see where the problem is.

@Caroline: did you check on the existence of the cnr index in your installation?