Summary: | Tools > Data export : "Don't export fields" option doesn't work | ||
---|---|---|---|
Product: | Koha | Reporter: | Francois Charbonnier <francois.charbonnier> |
Component: | Tools | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P3 | CC: | chris, jonathan.druart, mtj, robin, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13040 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | 10996 | ||
Bug Blocks: | |||
Attachments: |
Bug 12860: the export tools explodes if a field is not exported
Bug 12860: the export tools explodes if a field is not exported [PASSED QA] [PASSED QA] Bug 12860: the export tools explodes if a field is not exported |
Description
Francois Charbonnier
2014-09-02 19:05:53 UTC
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 |