I have just tested the data export tool on master. The option "Don't export fields" doesn't work for a field tag (ie 650) but works for a subfield tag (ie 650a).
on Bug 13040 Comment 3 I do a bit of diagnosis of this, copy pasting the relevant bits here: Looking at the code, this can't work: if ( $f =~ m/^(\d{3})(.)?$/ ) { my ( $field, $subfield ) = ( $1, $2 ); # skip if this record doesn't have this field if ( defined $record->field($field) ) { if ( defined $subfield ) { my @tags = $record->field($field); foreach my $t (@tags) { $t->delete_subfields($subfield); } } else { $record->delete_fields($field); } } } where the 'delete_fields' line is the one causing the error. It can't take a tag like the regex pulls out, it must take a MARC::Field.
Created attachment 35610 [details] [review] Bug 12860: the export tools explodes if a field is not exported To reproduce: 1/ Go on tools/export.pl 2/ Export some records and specify you don't want the fields 245 (the whole field, do not specify a subfield). 3/ Export, BOOM Software error: Arguments must be MARC::Field object at /home/koha/src/tools/export.pl line 400. Test plan: Apply the patch and confirm the fields 245 are not exported and the export works as expected.
Created attachment 35614 [details] [review] Bug 12860: the export tools explodes if a field is not exported To reproduce: 1/ Go on tools/export.pl 2/ Export some records and specify you don't want the fields 245 (the whole field, do not specify a subfield). 3/ Export, BOOM Software error: Arguments must be MARC::Field object at /home/koha/src/tools/export.pl line 400. Test plan: Apply the patch and confirm the fields 245 are not exported and the export works as expected. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Export fails to asplode with this patch
(In reply to Robin Sheat from comment #3) > Created attachment 35614 [details] [review] [review] > Signed-off-by: Robin Sheat <robin@catalyst.net.nz> > > Export fails to asplode with this patch Hum? What happen with this patch?
(In reply to Jonathan Druart from comment #4) > (In reply to Robin Sheat from comment #3) > > Created attachment 35614 [details] [review] [review] [review] > > > Signed-off-by: Robin Sheat <robin@catalyst.net.nz> > > > > Export fails to asplode with this patch > > Hum? What happen with this patch? Nothing, that's what I said :-)
Created attachment 35619 [details] [review] [PASSED QA] [PASSED QA] Bug 12860: the export tools explodes if a field is not exported To reproduce: 1/ Go on tools/export.pl 2/ Export some records and specify you don't want the fields 245 (the whole field, do not specify a subfield). 3/ Export, BOOM Software error: Arguments must be MARC::Field object at /home/koha/src/tools/export.pl line 400. Test plan: Apply the patch and confirm the fields 245 are not exported and the export works as expected. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Export fails to asplode with this patch Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Patch pushed to master. Thanks Jonathan!
Pushed to 3.18.x will be in 3.18.4
(In reply to Chris Cormack from comment #8) > Pushed to 3.18.x will be in 3.18.4 Pushed to 3.16.x, will be in 3.16.8