Bug 21316: Handle control fields in the ACQ frameworks
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 5 Mar 2019 19:09:07 +0000 (16:09 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 19 Jul 2019 08:37:02 +0000 (09:37 +0100)
Test plan:
- Turn UseACQFrameworkForBiblioRecords on
- Add 003@ to the ACQ framework
- Create an order from an existing record
=> The 003 value will be displayed!

It fixes the following error:
Control fields (generally, just tags below 010) do not have subfields,
use data() at /home/vagrant/kohaclone/acqui/neworderempty.pl line 293.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

acqui/neworderempty.pl

index 86e7339..fb1b66a 100755 (executable)
@@ -290,7 +290,7 @@ if ( not $ordernumber or $biblionumber ) {
                 next if IsMarcStructureInternal($mss);
                 next if $mss->{tab} == -1;
                 # We only need to display the values
-                my $value = join '; ', map { $_->subfield( $subfield ) } @fields;
+                my $value = join '; ', map { $tag < 10 ? $_->data : $_->subfield( $subfield ) } @fields;
                 if ( $value ) {
                     push @catalog_details, {
                         tag => $tag,