Bug 37879

Summary: Whitespaces mess with report results
Product: Koha Reporter: Afroditi Fragkou <infoscienceaddict>
Component: CatalogingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: new feature    
Priority: P5 - low CC: m.de.rooy
Version: 23.05   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Afroditi Fragkou 2024-09-10 09:56:12 UTC
When a whitespace character (such as a space, tab, or line break) is accidentally added at the end of a subfield, it can cause issues in SQL reports. Specifically, it shifts all subsequent fields to the next columns, which disrupts the results.

For example, if I select authid, 670$a, and 670$b from the auth_header table, and a space or tab has been added at the end of the 670$a subfield data in, say, the 3rd authority record, the resulting CSV will have an empty 670$b column. The data from 670$b will appear in the 1st column of the 4th line, the authid of the 4th record will be in the 670$a column, and so on.

Therefore, would it be possible to add a tool or something that prevents catalogers from adding or pasting text that starts or ends with a whitespace character?
Comment 1 Afroditi Fragkou 2024-09-10 09:59:13 UTC
Also if double spaces in between could be omitted would be great too :D