Bug 16365: Adding additional unsafe call-candidates from Acquisition
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 28 Jul 2016 08:29:18 +0000 (10:29 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 9 Sep 2016 10:43:26 +0000 (10:43 +0000)
[1] Candidate 1 is FillWithDefaultValues.
This routine in Acquisition.pm does not autovivify the tagslib
structure but first collects the keys at tag and subfield level.
So, unsafe can be safely added here :)

[2] Candidate 2 is script acqui/neworderempty.pl.
It only (!) uses GetMarcStructure to know if there is a ACQ framework.
There should be cheaper ways to do it, but when we use the fast cache,
it does not matter that much anymore.

[3] Candidate 3 is script acqui/orderreceive.pl. Same reason as [2].

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with neworderempty.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Acquisition.pm
acqui/neworderempty.pl
acqui/orderreceive.pl

index 6a2ed3e..1d82f8a 100644 (file)
@@ -3010,7 +3010,7 @@ If the field does not exist, it will be created too.
 
 sub FillWithDefaultValues {
     my ($record) = @_;
-    my $tagslib = C4::Biblio::GetMarcStructure( 1, 'ACQ' );
+    my $tagslib = C4::Biblio::GetMarcStructure( 1, 'ACQ', { unsafe => 1 } );
     if ($tagslib) {
         my ($itemfield) =
           C4::Biblio::GetMarcFromKohaField( 'items.itemnumber', '' );
index 10f6074..9045539 100755 (executable)
@@ -246,7 +246,7 @@ $template->param( sort2 => $data->{'sort2'} );
 
 if (C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber) {
     # Check if ACQ framework exists
-    my $marc = GetMarcStructure(1, 'ACQ');
+    my $marc = GetMarcStructure(1, 'ACQ', { unsafe => 1 } );
     unless($marc) {
         $template->param('NoACQframework' => 1);
     }
index d815022..5be38a2 100755 (executable)
@@ -111,7 +111,7 @@ unless ( $results and @$results) {
 my $order = $results->[0];
 
 # Check if ACQ framework exists
-my $acq_fw = GetMarcStructure(1, 'ACQ');
+my $acq_fw = GetMarcStructure( 1, 'ACQ', { unsafe => 1 } );
 unless($acq_fw) {
     $template->param('NoACQframework' => 1);
 }