Bug 32547 - Koha::Item->as_marc_field ignores more_subfields_xml
Summary: Koha::Item->as_marc_field ignores more_subfields_xml
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: 21.11
Hardware: All All
: P5 - low major (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-29 12:31 UTC by Tomás Cohen Arazi
Modified: 2023-12-28 20:43 UTC (History)
1 user (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 Tomás Cohen Arazi 2022-12-29 12:31:19 UTC
The method, as introduced on bug 23807, handled the extra subfields correctly.

Probably due to the changes introduced by bug 28445, it now doesn't. This is really bad.
Comment 1 Tomás Cohen Arazi 2022-12-29 12:45:20 UTC
I think the bug references are wrong, as I cannot reproduce in master. But this bug is present in 21.11 and wasn't on 20.05
Comment 2 Tomás Cohen Arazi 2022-12-29 13:01:24 UTC
I confirm this problem is only present in 21.11.

Steps to reproduce:

0. Launch a 21.11 KTD:
   # stop any running KTD
   $ ktd down
   $ git checkout origin/21.11.x -b bug_32547
   $ KOHA_IMAGE=21.11 ktd up -d

1. Edit the default framework field 952, add a 'R' subfield for items. Make sure you set:

tab: 10
visibility: opac, staff, editor

2. Pick a biblio and make sure it uses the default framework. I searched for 'att' and picked  "Introduction to Attic Greek / Donald J. Mastronarde." from the sample dataset.
3. Add an item, set the 'R' subfield to some value.
4. Run:
   $ kshell
  k$ perl -MKoha::Items -MData::Printer -e 'my $item = Koha::Items->find(973); p($item->as_marc_field->as_formatted);'
=> FAIL: the output doesn't show subfield R.
Comment 3 Tomás Cohen Arazi 2022-12-29 13:20:57 UTC
I'm going to close this. It seems that the problem is the frameworks contained '' for kohafield instead of NULL, and the code checks 

    if ( defined $kohafield )

Will double check on the different branches how this looks. But closing for now.