[Bug 36081] New: ArticleRequestsSupportedFormats not enforced server-side
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Bug ID: 36081 Summary: ArticleRequestsSupportedFormats not enforced server-side Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 20472 ./opac-request-article.tt // Initialize format(s) var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') | $raw %]"; if( !supported_formats.match(/PHOTOCOPY/) ) $('#format option[value="PHOTOCOPY"]').remove(); if( !supported_formats.match(/SCAN/) ) $('#format option[value="SCAN"]').remove(); This is the only place we deal with ArticleRequestsSupportedFormats... Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20472 [Bug 20472] Add digital scan as optional format to Article Requests -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Group|Koha security | Component|Koha |Circulation CC| |gmcharlt@gmail.com, | |kyle.m.hall@gmail.com Version(s)| |25.05.00,24.11.02,24.05.07, released in| |23.11.12,22.11.24 Product|Koha security |Koha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |Main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #43 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Something is not quite "tidy" with these patches. I am fixing before push. FAIL C4/Context.pm FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl C4/Context.pm` OK Koha/ArticleRequest.pm OK Koha/Exceptions/ArticleRequest.pm FAIL Koha/Template/Plugin/Koha.pm FAIL pod coverage POD is missing for MultivaluePreference FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl Koha/Template/Plugin/Koha.pm` FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt` OK t/Context.t FAIL t/db_dependent/ArticleRequests.t FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl t/db_dependent/ArticleRequests.t` OK t/db_dependent/Koha/ArticleRequest.t OK t/db_dependent/Koha/Biblio.t OK t/db_dependent/Koha/Patron.t FAIL t/lib/TestBuilder.pm FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl t/lib/TestBuilder.pm` Marcel, can you check you are using "the latest" of everything? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #44 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #43)
Marcel, can you check you are using "the latest" of everything?
Probably not on Feb 14 ;) Now I have this commit on top: commit 2c62b862ef264d9fb427111cedb8b0e9673f8ca1 (HEAD -> main, origin/main, origin/HEAD) Author: Jonathan Druart <jonathan.druart@gmail.com> Date: Sat Feb 15 05:52:14 2025 +0100 Issue #90: Use relpath instead of abspath for tidy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #45 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Marcel de Rooy from comment #44)
(In reply to Katrin Fischer from comment #43)
Marcel, can you check you are using "the latest" of everything?
Probably not on Feb 14 ;) Now I have this commit on top: commit 2c62b862ef264d9fb427111cedb8b0e9673f8ca1 (HEAD -> main, origin/main, origin/HEAD) Author: Jonathan Druart <jonathan.druart@gmail.com> Date: Sat Feb 15 05:52:14 2025 +0100 Issue #90: Use relpath instead of abspath for tidy
We also had some reported issues where node_modules needed to be deleted to make things work. I have now tidied the files and squashed the changes into the right patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.05.00,24.11.02,24.05.07, |25.05.00,25.05.00,24.11.02, released in|23.11.12,22.11.24 |24.05.07,23.11.12,22.11.24 Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #46 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.05.00,25.05.00,24.11.02, |25.05.00,24.11.02,24.05.07, released in|24.05.07,23.11.12,22.11.24 |23.11.12,22.11.24 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to main |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #47 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This patch set causes an issue in 22.11 (maybe newer versions as well): * The hints are removed, but the input remains a text input instead of a sortable multi-select. * If the field is empty, the users can no longer place article requests until a valid entry is generated. Maybe we should add back the hint at least about allowed values? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #48 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #47)
This patch set causes an issue in 22.11 (maybe newer versions as well): * The hints are removed, but the input remains a text input instead of a sortable multi-select. * If the field is empty, the users can no longer place article requests until a valid entry is generated.
Maybe we should add back the hint at least about allowed values?
The multiple_sortable is added on bug 29948. And was pushed to 24.05. In 23.11 I am still seeing the hint: (Valid choices are currently: PHOTOCOPY and SCAN. Separate the supported formats by a vertical bar. The first listed format is selected by default when you request via the OPAC.) Please clarify. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #49 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #48)
Please clarify.
Hmm 23.11.12. I did not locally apply this one ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #50 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- So we just need this one line: - "(Valid choices are currently: PHOTOCOPY and SCAN. Separate the supported formats by a vertical bar. The first listed format is selected by default when you request via the OPAC.)" Could this be added by the RMaints ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #51 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #47)
This patch set causes an issue in 22.11 (maybe newer versions as well): * The hints are removed, but the input remains a text input instead of a sortable multi-select. * If the field is empty, the users can no longer place article requests until a valid entry is generated.
Maybe we should add back the hint at least about allowed values?
I reported it for 22.11 and there it's presenting differently. The | note is gone and it says: The first listed format is selected by default when you request via the OPAC. (In reply to Marcel de Rooy from comment #50)
So we just need this one line: - "(Valid choices are currently: PHOTOCOPY and SCAN. Separate the supported formats by a vertical bar. The first listed format is selected by default when you request via the OPAC.)"
Could this be added by the RMaints ?
If 23.11 is OK that's good, but in 22.11.24 it reads: The first listed format is selected by default when you request via the OPAC. So we might have different backports to deal with. We also had some trouble when the field was empty, which is the bigger issue here as it was hard to detect/figure out and requires understanding the logs to do so. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #52 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #51)
(In reply to Katrin Fischer from comment #47)
This patch set causes an issue in 22.11 (maybe newer versions as well): * The hints are removed, but the input remains a text input instead of a sortable multi-select. * If the field is empty, the users can no longer place article requests until a valid entry is generated.
Maybe we should add back the hint at least about allowed values?
I reported it for 22.11 and there it's presenting differently. The | note is gone and it says:
The first listed format is selected by default when you request via the OPAC. (In reply to Marcel de Rooy from comment #50)
So we just need this one line: - "(Valid choices are currently: PHOTOCOPY and SCAN. Separate the supported formats by a vertical bar. The first listed format is selected by default when you request via the OPAC.)"
Could this be added by the RMaints ?
If 23.11 is OK that's good, but in 22.11.24 it reads: The first listed format is selected by default when you request via the OPAC.
So we might have different backports to deal with. We also had some trouble when the field was empty, which is the bigger issue here as it was hard to detect/figure out and requires understanding the logs to do so.
No my 23.11 is good. But 23.11.12 isnt. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #53 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 181287 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181287&action=edit Bug 36081: [23.11.x and lower] Remove multiple_sortable This depends on bug 29948 (24.05). Just removing it here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #54 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Katrin: Please adjust statuses so that RMt will pick it up. 23.11 and lower. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #55 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Note also that multiple_sortable adds a comma instead of a vertical bar that we had previously. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #56 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Still checking it we are fine yet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #57 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #56)
Still checking it we are fine yet.
I think so, looking at the code. Dont have a working 23.11.12 at hand here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #58 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- But there is an issue from 24.05 onwards: // Select first listed format var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, ''); $('#format option[value="'+first_format+'"]').attr('selected', true); This still looks at vertical bar in request-article.tt and opac counterpart. But the sortable stuff adds a comma? Jonathan: Could you confirm this please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |--- Status|RESOLVED |REOPENED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|REOPENED |RESOLVED --- Comment #59 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- We should probably put this on a separate report with a new number, as they have been both released (thinking release notes) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39699 --- Comment #60 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #59)
We should probably put this on a separate report with a new number, as they have been both released (thinking release notes)
Filed new bug: Bug 39699 - [23.11 and lower] Fix system preference description of ArticleRequestsSupportedFormats Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39699 [Bug 39699] [23.11 and lower] Fix system preference description of ArticleRequestsSupportedFormats -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #61 from Jonathan Druart <jonathan.druart@gmail.com> --- I am not sure what happened here, but the code in main and the patches attached here are not the same. Compare the change to opac-request-article.tt from "Bug 36081: Use multivalue_preference" for instance: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178070 vs https://git.koha-community.org/Koha-community/Koha/commit/ddc0e07bab2d819465... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39707 --- Comment #62 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #61)
I am not sure what happened here, but the code in main and the patches attached here are not the same.
Compare the change to opac-request-article.tt from "Bug 36081: Use multivalue_preference" for instance: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178070 vs https://git.koha-community.org/Koha-community/Koha/commit/ ddc0e07bab2d81946560891d2795764daeb9f1c9
See bug 39707 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39707 [Bug 39707] Fix JS error when placing a request -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #63 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #62)
(In reply to Jonathan Druart from comment #61)
I am not sure what happened here, but the code in main and the patches attached here are not the same.
Compare the change to opac-request-article.tt from "Bug 36081: Use multivalue_preference" for instance: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178070 vs https://git.koha-community.org/Koha-community/Koha/commit/ ddc0e07bab2d81946560891d2795764daeb9f1c9
See bug 39707
I pushed the "main" versions and obsoleted the 24.05 versions that were already pushed to the security release. To maybe the difference was there? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #64 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Katrin Fischer from comment #63)
(In reply to Jonathan Druart from comment #62)
(In reply to Jonathan Druart from comment #61)
I am not sure what happened here, but the code in main and the patches attached here are not the same.
Compare the change to opac-request-article.tt from "Bug 36081: Use multivalue_preference" for instance: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178070 vs https://git.koha-community.org/Koha-community/Koha/commit/ ddc0e07bab2d81946560891d2795764daeb9f1c9
See bug 39707
I pushed the "main" versions and obsoleted the 24.05 versions that were already pushed to the security release. To maybe the difference was there?
I don't understand what you mean. The patch and commit from comment #61 are for main, they should be the same, they are not. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36081 --- Comment #65 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Looks like a good catch on 39707. When looking at both diffs, I have the idea that they have more or less the same result when applied but this might just depend on different git versions used. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org