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.
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
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.
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.