[Koha-bugs] [Bug 29773] New: suggestion.pl event listener too restrictive

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 27 20:13:19 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29773

            Bug ID: 29773
           Summary: suggestion.pl event listener too restrictive
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Acquisitions
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: cbrannon at cdalibrary.org
        QA Contact: testopia at bugs.koha-community.org

Suggestion.pl has an event listener that is listening to all buttons of the
type submit, which requires the user to select at least one suggestion on the
page.  This prevents other buttons of a submit type that have nothing to do
with that particular form from being added to the page and working without this
same restriction.

$("button[type='submit']").on("click", function(e) {
                    var submit_button = this;
                    var form = $(submit_button).parents("form");
                    var action = $(submit_button).val();
                    var selected_suggestions =
$(form).find("input[name='suggestionid']:checked");
                    if ( selected_suggestions.length == 0 ) {
                        alert(_("Please select at least one suggestion"));
                        e.preventDefault();
                        return false;
                    }

needs to be rewritten so that it is limited to the 4 buttons at the bottom of
the page only.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list