[Bug 39944] New: Metadata should be trimmed before creating an ILL request
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Bug ID: 39944 Summary: Metadata should be trimmed before creating an ILL request Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ILL Assignee: pedro.amorim@openfifth.co.uk Reporter: pedro.amorim@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: pedro.amorim@openfifth.co.uk, tomascohen@gmail.com When creating an ILL request, if the form data contains leading or trailing whitespaces, this may cause issues for backends. Example: A DOI is entered as ' 123', instead of '123'. If the backend needs to use that data entry, it'll need to first trim and/or sanitize it. It's better if core Koha does this trimming before delegating the creation of the request to the backend, so it's maintained in a single place. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 --- Comment #1 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 182668 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182668&action=edit Bug 39944: Add tests prove t/db_dependent/Koha/ILL/Request.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 --- Comment #2 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 182669 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182669&action=edit Bug 39944: Trim form params Test plan, ktd, before applying patch: 1) Enable ILLModule sys pref and create a new ILL request: <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard 2) Pick type 'journal article' and enter ' 123' to DOI (notice the leading white space) 3) Enter a cardnumber and a library. Click 'Create'. 4) Run the following SQL query (koha-mysql kohadev): $ SELECT * from illrequestattributes where illrequest_id = '<put your request ID here>' and type ='doi'; 5) Notice the value is saved with the leading whitespace. Apply patch. Repeat. Notice it no longer saves with the leading white space. Sponsored-by: NHS England -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182668|0 |1 is obsolete| | --- Comment #3 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 182672 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182672&action=edit Bug 39944: Add tests prove t/db_dependent/Koha/ILL/Request.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182669|0 |1 is obsolete| | --- Comment #4 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 182673 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182673&action=edit Bug 39944: Trim form params Test plan, ktd, before applying patch: 1) Enable ILLModule sys pref and create a new ILL request: <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard 2) Pick type 'journal article' and enter ' 123' to DOI (notice the leading white space) 3) Enter a cardnumber and a library. Click 'Create'. 4) Run the following SQL query (koha-mysql kohadev): $ SELECT * from illrequestattributes where illrequest_id = '<put your request ID here>' and type ='doi'; 5) Notice the value is saved with the leading whitespace. Apply patch. Repeat. Notice it no longer saves with the leading white space. Sponsored-by: NHS England -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> --- Automatic patch test results: â ï¸ The patch applies with fuzzy option (ignoring whitespace). This may indicate minor conflicts that need to be resolved. Details: Patch applies with fuzzy option (ignoring whitespace) This is an automated message from the patch testing system. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182672|0 |1 is obsolete| | --- Comment #6 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 189929 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189929&action=edit Bug 39944: Add tests prove t/db_dependent/Koha/ILL/Request.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182673|0 |1 is obsolete| | --- Comment #7 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 189930 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189930&action=edit Bug 39944: Trim form params Test plan, ktd, before applying patch: 1) Enable ILLModule sys pref and create a new ILL request: <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard 2) Pick type 'journal article' and enter ' 123' to DOI (notice the leading white space) 3) Enter a cardnumber and a library. Click 'Create'. 4) Run the following SQL query (koha-mysql kohadev): $ SELECT * from illrequestattributes where illrequest_id = '<put your request ID here>' and type ='doi'; 5) Notice the value is saved with the leading whitespace. Apply patch. Repeat. Notice it no longer saves with the leading white space. Sponsored-by: NHS England -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189929|0 |1 is obsolete| | --- Comment #8 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 190019 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190019&action=edit Bug 39944: Add tests prove t/db_dependent/Koha/ILL/Request.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189930|0 |1 is obsolete| | --- Comment #9 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 190020 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190020&action=edit Bug 39944: Trim form params Test plan, ktd, before applying patch: 1) Enable ILLModule sys pref and create a new ILL request: <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard 2) Pick type 'journal article' and enter ' 123' to DOI (notice the leading white space) 3) Enter a cardnumber and a library. Click 'Create'. 4) Run the following SQL query (koha-mysql kohadev): SELECT CONCAT('(', REPLACE(value, ' ', ' '), ')') AS 'Value with parenthesis concatenated' FROM illrequestattributes WHERE illrequest_id = 1 AND type = 'doi'; 5) Notice the value is saved with the leading whitespace. Apply patch. Repeat. Notice it no longer saves with the leading white space. Sponsored-by: NHS England -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190019|0 |1 is obsolete| | --- Comment #10 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 190022 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190022&action=edit Bug 39944: Add tests prove t/db_dependent/Koha/ILL/Request.t Signed-off-by: Richard Bridgen <richard.bridgen@nhs.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190020|0 |1 is obsolete| | --- Comment #11 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- Created attachment 190023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190023&action=edit Bug 39944: Trim form params Test plan, ktd, before applying patch: 1) Enable ILLModule sys pref and create a new ILL request: <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard 2) Pick type 'journal article' and enter ' 123' to DOI (notice the leading white space) 3) Enter a cardnumber and a library. Click 'Create'. 4) Run the following SQL query (koha-mysql kohadev): SELECT CONCAT('(', REPLACE(value, ' ', ' '), ')') AS 'Value with parenthesis concatenated' FROM illrequestattributes WHERE illrequest_id = 1 AND type = 'doi'; 5) Notice the value is saved with the leading whitespace. Apply patch. Repeat. Notice it no longer saves with the leading white space. Sponsored-by: NHS England Signed-off-by: Richard Bridgen <richard.bridgen@nhs.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m Comma delimited| |NHS England list of Sponsors| | Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39944 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org