Bug 22410 - Software error while adding order on a MARC file record without an author
Summary: Software error while adding order on a MARC file record without an author
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Pierre-Marc Thibault
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-25 18:04 UTC by Pierre-Marc Thibault
Modified: 2020-01-06 20:17 UTC (History)
3 users (show)

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


Attachments
Bug 22410: Skip normalizing author if the author is undefined (1.79 KB, patch)
2019-02-25 18:53 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
MARC file test (1.51 KB, text/plain)
2019-03-26 12:23 UTC, Pierre-Marc Thibault
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Marc Thibault 2019-02-25 18:04:35 UTC
When one wants to add an order on a record from a MARC file, if the record doesn't have a filled tag 100, it leads to a software error.
Comment 1 Pierre-Marc Thibault 2019-02-25 18:53:41 UTC
Created attachment 85667 [details] [review]
Bug 22410: Skip normalizing author if the author is undefined

Since a record can have a defined author or not and the code needs it at some point, a condition has been added. It verifies if records have an defined author (tag 100). If it's the case, the author is normalized. If not, that is skipped.

Test plan:
1) Set the system preference z3950NormalizeAuthor at Copy.
2) Have at least one tag in the field.
3) Have a MARC file with at least 2 records without tag 100.
   They don't have to be in the same file.
4) Go to Tools > Stage MARC records for import.
5) Stage your file with the character encoding: MARC 8.
4) Go to Acquisitions and add an order to a basket from a staged file.
5) Click on "Add orders" from your file.
6) Click on "Add order" for a record.
7) Software error occurs.
8) Apply patch.
9) Click on "Add order" for another record.
10) Software error doesn't occur.
Comment 2 Devinim 2019-03-12 19:58:06 UTC
Hi Pierre-Marc,

We have followed your steps. However we didn't get any error as you mentioned in step 7.

The MARC file without tag 100 inserted into the system without any error.

Devinim Koha Team
Comment 3 Pierre-Marc Thibault 2019-03-22 18:39:31 UTC
This is strange because I get it consistently. On my own side, I create MARC files with records without tag 100 by going to "tools > Export data" and I can confirm there are no tags 100 in records before the software error with the MARC link after step 5.
Comment 4 Liz Rea 2019-03-25 19:57:47 UTC
Hi Pierre,

Are you cataloguing in UNIMARC? Could you provide some UNIMARC import files for us to test with, if so?

Cheers,
Liz
Comment 5 Pierre-Marc Thibault 2019-03-26 12:19:25 UTC
(In reply to Liz Rea from comment #4)
> Are you cataloguing in UNIMARC? Could you provide some UNIMARC import files
> for us to test with, if so?

If I check my preference marcflavour which is set at MARC21, I don't think so, but either way I will add my test file so I can have more feedback if it doesn't work, which I don't hope.
Comment 6 Pierre-Marc Thibault 2019-03-26 12:23:53 UTC
Created attachment 87012 [details]
MARC file test

To use since test plan is not always reproductible.
Comment 7 Liz Rea 2019-03-29 15:59:14 UTC
Ok, Question.

 z3950NormalizeAuthor
z3950AuthorAuthFields (modified) 	
Copy|don't copy authors from the UNIMARC tags (separated by commas) [list of tags] to the correct author tags when importing a record using Z39.50. 

This feature is UNIMARC only? If your catalogue is MARC21, why would you have this preference set at all?

Cheers,
Liz
Comment 8 Pierre-Marc Thibault 2019-03-29 19:57:14 UTC
Hi Liz,

I read your last comment and it seems like the patch problem wasn't a problem in the end. By talking with a co-worker, I realize the software error occurred because z3950NormalizeAuthor was set to Copy while marcflavour was at MARC21. I didn't think a configuration problem could lead to this so I tried to make the error disappears with this configuration. 

I will close this ticket since the problem is irrelevant and I can change z3950NormalizeAuthor to fix my problem. Thank you for your feedback.