Bug 11200 - Adding subfield without field in addbiblio.pl
Summary: Adding subfield without field in addbiblio.pl
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nuño López Ansótegui
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-05 10:02 UTC by Nuño López Ansótegui
Modified: 2019-12-16 09:50 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 11200 - Adding subfield without field in addbiblio.pl (2.66 KB, patch)
2013-11-05 10:32 UTC, Nuño López Ansótegui
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nuño López Ansótegui 2013-11-05 10:02:58 UTC
In addbiblio.pl, subfield is adding but don't check if field exist.

if ($title) {

#                         $field->add_subfields("$subfield"=>"[ ".ucfirst($title).ucfirst($firstname)." ".$number." ]");
                        $field->add_subfields(
                                "$subfield" => ucfirst($title) . " "
                              . ucfirst($firstname) . " "
                              . $number );
                    }
                    else {

#                       $field->add_subfields("$subfield"=>"[ ".ucfirst($firstname).", ".ucfirst($lastname)." ]");
                        $field->add_subfields(
                            "$subfield" => ucfirst($firstname) . ", "
                              . ucfirst($lastname) );
                    }
Comment 1 Nuño López Ansótegui 2013-11-05 10:32:57 UTC
Created attachment 22716 [details] [review]
Bug 11200 - Adding subfield without field in addbiblio.pl
Comment 2 Owen Leonard 2013-11-14 13:49:18 UTC
Please provide a more thorough description of the problem this fixes and a test plan.
Comment 3 Marc Véron 2015-12-24 13:55:25 UTC
Is this bug still valid?
Comment 4 Mark Tompsett 2016-03-30 18:53:34 UTC
(In reply to Marc Véron from comment #3)
> Is this bug still valid?

From my quick skim of the code, I think maybe so.

If you have z3950NormalizeAuthor, z3950AuthorAuthFields, and UNIMARC...
and you lack a biblio.author field, as defined in marc_subfields_structure tagfield and subtagfield, in the record, then $field never gets defined. If it isn't defined, I would expect $field->add_subfields() to explode.
Comment 5 Jonathan Druart 2019-12-16 09:50:22 UTC
Lowering severity as we do not have a test plan to recreate the problem.