[Bug 22657] New: Remove JavaScript from OPAC suggestion validation of required fields
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Bug ID: 22657 Summary: Remove JavaScript from OPAC suggestion validation of required fields Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org Target Milestone: --- The OPAC suggestion form required JavaScript in order to make required fields mandatory. I think we should replace this with HTML5 'required' attributes and more processing in the template. This makes the form fit better with the general goal of progressive enhancement for the OPAC. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 87526 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=87526&action=edit Bug 22657: Remove JavaScript from OPAC suggestion validation of required fields This patch modifies the OPAC suggestion form so that it doesn't require JavaScript for form validation. This change doesn't alter the behavior of the form for users but does fit with the general goal of progressive enhancement for the OPAC. The patch adds "required" labels to required fields to better identify required fields. To test, apply the patch and make sure there are required fields specified in the OPACSuggestionMandatoryFields system preference. - Log in to the OPAC and go to Your purchase suggestions -> New purchase suggestion. - Verify that the fields specified in OPACSuggestionMandatoryFields are highlighted and marked "required." - Verify that you can't submit the form without filling out these fields. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Bin <bin.wen@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #87526|0 |1 is obsolete| | --- Comment #2 from Bin <bin.wen@inlibro.com> --- Created attachment 87939 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=87939&action=edit Bug 22657: Remove JavaScript from OPAC suggestion validation of required fields This patch modifies the OPAC suggestion form so that it doesn't require JavaScript for form validation. This change doesn't alter the behavior of the form for users but does fit with the general goal of progressive enhancement for the OPAC. The patch adds "required" labels to required fields to better identify required fields. To test, apply the patch and make sure there are required fields specified in the OPACSuggestionMandatoryFields system preference. - Log in to the OPAC and go to Your purchase suggestions -> New purchase suggestion. - Verify that the fields specified in OPACSuggestionMandatoryFields are highlighted and marked "required." - Verify that you can't submit the form without filling out these fields. Signed-off-by: Bin Wen <bin.wen@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Bin <bin.wen@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bin.wen@inlibro.com 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=22657 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 88132 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=88132&action=edit Screenshot of wandering required message Something is a bit odd here: - Go to the OPAC - New purchase suggestion (title is required) - Submit - Please fill out this field is shown - Scroll - Verify the note stays in the same place while the form moves Owen, can you please check? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Katrin Fischer from comment #3)
- Scroll - Verify the note stays in the same place while the form moves
The validation is done using the browser's built-in interpretation of the HTML5 attribute "required." What you see appears to be a browser bug. I see it in Firefox but not Chrome. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Owen Leonard from comment #4)
(In reply to Katrin Fischer from comment #3)
- Scroll - Verify the note stays in the same place while the form moves
The validation is done using the browser's built-in interpretation of the HTML5 attribute "required." What you see appears to be a browser bug. I see it in Firefox but not Chrome.
Actually, I was kind of afraid you'd say that. Should we push or wait a bit until this is fixed? on the form it's really confusing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Signed Off |Patch doesn't apply --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Sorry Owen, bug 22800 created a conflict with this one: CONFLICT (content): Merge conflict in opac/opac-suggestions.pl CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #87939|0 |1 is obsolete| | --- Comment #7 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 89504 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89504&action=edit Bug 22657: Remove JavaScript from OPAC suggestion validation of required fields This patch modifies the OPAC suggestion form so that it doesn't require JavaScript for form validation. This change doesn't alter the behavior of the form for users but does fit with the general goal of progressive enhancement for the OPAC. The patch adds "required" labels to required fields to better identify required fields. To test, apply the patch and make sure there are required fields specified in the OPACSuggestionMandatoryFields system preference. - Log in to the OPAC and go to Your purchase suggestions -> New purchase suggestion. - Verify that the fields specified in OPACSuggestionMandatoryFields are highlighted and marked "required." - Verify that you can't submit the form without filling out these fields. Signed-off-by: Bin Wen <bin.wen@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- A good reason for that change: - @mandatoryfields = sort split(/\s*\,\s*/, $fldsreq_sp); + @mandatoryfields = split( ",", $fldsreq_sp ); ? I think the regex must be kept as it, just in case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 89520 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89520&action=edit Bug 22657: (QA follow-up) Restore previous version of regex This patch restores the previous version of the regular expression which parses the OPACSuggestionMandatoryFields system preference value. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #89504|0 |1 is obsolete| | --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 89525 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89525&action=edit Bug 22657: Remove JavaScript from OPAC suggestion validation of required fields This patch modifies the OPAC suggestion form so that it doesn't require JavaScript for form validation. This change doesn't alter the behavior of the form for users but does fit with the general goal of progressive enhancement for the OPAC. The patch adds "required" labels to required fields to better identify required fields. To test, apply the patch and make sure there are required fields specified in the OPACSuggestionMandatoryFields system preference. - Log in to the OPAC and go to Your purchase suggestions -> New purchase suggestion. - Verify that the fields specified in OPACSuggestionMandatoryFields are highlighted and marked "required." - Verify that you can't submit the form without filling out these fields. Signed-off-by: Bin Wen <bin.wen@inlibro.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #89520|0 |1 is obsolete| | --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 89526 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89526&action=edit Bug 22657: (QA follow-up) Restore previous version of regex This patch restores the previous version of the regular expression which parses the OPACSuggestionMandatoryFields system preference value. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Keywords| |rel_19_05_candidate --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- This is cleanup I would like to see move ahead if the browser issue is reasonable, will test next week so considering for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #13 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #5)
The validation is done using the browser's built-in interpretation of the HTML5 attribute "required." What you see appears to be a browser bug. I see it in Firefox but not Chrome.
Actually, I was kind of afraid you'd say that. Should we push or wait a bit until this is fixed? on the form it's really confusing.
I don't think this is too bad, the red highlight makes it fairly obvious which field and any click clears. Still keeping my fingers crossed for firefox to fix it -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Pushed to Master |RESOLVED Resolution|--- |FIXED --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Enhancement will not be backported to 18.11.x series. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org