[Bug 22657] New: Remove JavaScript from OPAC suggestion validation of required fields

classic Classic list List threaded Threaded
21 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] New: Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
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: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]
  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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Owen Leonard <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |Needs Signoff
   Patch complexity|---                         |Small patch

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

--- Comment #1 from Owen Leonard <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Bin <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #87526|0                           |1
        is obsolete|                            |

--- Comment #2 from Bin <[hidden email]> ---
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 <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Bin <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
             Status|Needs Signoff               |Signed Off

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #3 from Katrin Fischer <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Failed QA

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Owen Leonard <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Failed QA                   |Signed Off

--- Comment #4 from Owen Leonard <[hidden email]> ---
(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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

--- Comment #5 from Katrin Fischer <[hidden email]> ---
(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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]-c
                   |                            |ommunity.org
             Status|Signed Off                  |Patch doesn't apply

--- Comment #6 from Jonathan Druart <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Owen Leonard <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Patch doesn't apply         |Signed Off

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Owen Leonard <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #87939|0                           |1
        is obsolete|                            |

--- Comment #7 from Owen Leonard <[hidden email]> ---
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 <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

--- Comment #8 from Jonathan Druart <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

--- Comment #9 from Owen Leonard <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Passed QA

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #89504|0                           |1
        is obsolete|                            |

--- Comment #10 from Marcel de Rooy <[hidden email]> ---
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 <[hidden email]>

Signed-off-by: Marcel de Rooy <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #89520|0                           |1
        is obsolete|                            |

--- Comment #11 from Marcel de Rooy <[hidden email]> ---
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 <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
         QA Contact|[hidden email]-communit |[hidden email]
                   |y.org                       |

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
           Keywords|                            |rel_19_05_candidate

--- Comment #12 from Nick Clemens <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Pushed to Master

--- Comment #13 from Nick Clemens <[hidden email]> ---
Awesome work all!

Pushed to master for 19.05

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 22657] Remove JavaScript from OPAC suggestion validation of required fields

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22657

--- Comment #14 from Nick Clemens <[hidden email]> ---
(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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/