Bug 24392 - Leading whitespaces in Marc fields cause errors
Summary: Leading whitespaces in Marc fields cause errors
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-09 19:03 UTC by Christopher Brannon
Modified: 2020-01-14 07:23 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2020-01-09 19:03:31 UTC
We've discovered that leading whitespaces in at least the 947h field have caused error messages on bib records (detail.pl), and lists linked to the record to fail to load (shelves.pl).  Perhaps there should be something in place to either warn or automatically strip leading/trailing whitespaces on these fields, or something done to prevent these whitespaces from breaking things.
Comment 1 Jonathan Druart 2020-01-13 14:43:40 UTC
All good for me. Which Koha versions? Which errors in the koha logs? In the JS console? Can you attach the record to this bug report?
Comment 2 Christopher Brannon 2020-01-13 16:10:57 UTC
(In reply to Jonathan Druart from comment #1)
> All good for me. Which Koha versions? Which errors in the koha logs? In the
> JS console? Can you attach the record to this bug report?

Right now we are seeing this in 19.05.  I don't know about earlier versions.  The records were repaired, so I don't have an example at the moment.  I will see if I can recreate this manually.
Comment 3 Christopher Brannon 2020-01-13 16:38:57 UTC
(In reply to Jonathan Druart from comment #1)
> All good for me. Which Koha versions? Which errors in the koha logs? In the
> JS console? Can you attach the record to this bug report?

I can't manually recreate this, but I am checking with Bywater to see if they can.

I am suspecting the whitespace was transferred through a downloaded record, since I can't manually create the error.  Wonder if there needs to be something in place to strip leading whitespace on downloaded records?
Comment 4 Jonathan Druart 2020-01-13 16:49:39 UTC
No, edit a record, add trailing/leading whitespaces, save, edit again
=> Whitespaces are still there.
Comment 5 Christopher Brannon 2020-01-13 16:59:59 UTC
(In reply to Jonathan Druart from comment #4)
> No, edit a record, add trailing/leading whitespaces, save, edit again
> => Whitespaces are still there.

This isn't a matter of manually adding whitespace.  I can do that.  It just isn't creating the same effect.  So, there is something more specific about the whitespace that I don't know about.
Comment 6 Katrin Fischer 2020-01-14 07:23:02 UTC
(In reply to Christopher Brannon from comment #5)
> (In reply to Jonathan Druart from comment #4)
> > No, edit a record, add trailing/leading whitespaces, save, edit again
> > => Whitespaces are still there.
> 
> This isn't a matter of manually adding whitespace.  I can do that.  It just
> isn't creating the same effect.  So, there is something more specific about
> the whitespace that I don't know about.

Maybe it was not whitespace but some other non-printable characters that got in fro copy&pasting?