Summary: | Acquisitions, add order to basket, from new, no item field filed, AcqCreateItem=ordering cause internal error | ||
---|---|---|---|
Product: | Koha | Reporter: | Chris Hall <chrish> |
Component: | Acquisitions | Assignee: | Henri-Damien LAURENT <henridamien> |
Status: | CLOSED FIXED | QA Contact: | Ian Walls <koha.sekjal> |
Severity: | minor | ||
Priority: | PATCH-Sent (DO NOT USE) | CC: | chrish, mglavica, nengard, paul.poulain |
Version: | 3.6 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Patch adds a stronger check on adding a closing </datafield> tag
Patch adds a stronger check on adding a closing </datafield> tag [SIGNED-OFF] bug 7239 fix to avoid error being thrown even though a record is created |
Description
Chris Hall
2011-11-16 23:19:18 UTC
Created attachment 6324 [details] [review] Patch adds a stronger check on adding a closing </datafield> tag Here is a further explanation of the bug, I was planning to post it with the patch but the attach patch button took me to another page. The bug seems to be caused by the line: $xml .= "</datafield>\n" if @$tags > 0; in C4/Biblio.pm (line 1955) It seems that if the Source of classification or shelving scheme is not filed in then the resulting xml is: <collection$ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"> <record> </datafield> </record> </collection> and if you do fill in the field then the xml is: <collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"> <record> <datafield tag="952" ind1=" " ind2=" "> <subfield code="2">ddc</subfield> </datafield> </record> </collection> Patch places a stronger check on that line (checking if $xml contains a <datafield tag, rather than if $tags size is > 0) I think the problem is perhaps not classification source, but that you have to fill out at least one field from the items form. Normally I use itemtype, branches would probably work too. Bug 4955 might be a duplicate. Hey Katrin It appears you are right about any one of the fields having to be filled out, silly me. The issue described in bug 4955 seems to be related, sorry for the duplicate. I spent a lot of time in acq running into this problem a lot. Glad you came up with a patch for it - it's an annoying bug. Hi Chris, something seems to be wrong with your patch: git bz apply 7239 Bug 7239 - Acquisitions basket, add order to basket, from new, Source of classification or shelving scheme being blank caused internal error Patch adds a stronger check on adding a closing </datafield> tag Apply? [yn] y Patch format detection failed. git am -is3 /tmp/Patch-adds-a-stronger-check-on-adding-a-closing-da-zOWPN2.patch Patch format detection failed. Can you check and attach a new file please? Thx! Created attachment 6588 [details] [review] Patch adds a stronger check on adding a closing </datafield> tag Sorry about that, it seems I generated that using git diff rather than format-patch. Corrected formatted patch attached. Created attachment 6589 [details] [review] [SIGNED-OFF] bug 7239 fix to avoid error being thrown even though a record is created Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> When creating an item in acquisitions while ordering and not filling out any fields, there is no longer shown a perl error message. QA comment: description updated, everything else fine, 1 line patch works as expected *** Bug 4955 has been marked as a duplicate of this bug. *** *** Bug 7692 has been marked as a duplicate of this bug. *** This patch was included in 3.6.x prior to 3.6.4. |