[Bug 27250] New: DELETE calls are stacked on the SMTP servers admin page
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Bug ID: 27250 Summary: DELETE calls are stacked on the SMTP servers admin page Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: System Administration Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Depends on: 22343 To recreate: Create at least 2 SMTP servers Click "Delete" for server 1 => You get a successful message (OK) Click "Delete" for server 2 => You get a successful message (OK) => You get also an alert message about server 1 (KO) The DELETE route is called twice (one per Delete button you clicked) Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22343 [Bug 22343] Add configuration options for SMTP servers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 114434 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114434&action=edit Bug 27250: Prevent DELETE to be called several times on SMTP servers admin page The on click event is not replaced but added. We must unbind it before adding the second one To recreate: Create at least 2 SMTP servers Click "Delete" for server 1 => You get a successful message (OK) Click "Delete" for server 2 => You get a successful message (OK) => You get also an alert message about server 1 (KO) The DELETE route is called twice (one per Delete button you clicked) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 114480 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114480&action=edit [ALTERNATE] Bug 27250: Fix stacked event listeners in SMTP delete modal There is a design issue on the click event listener that makes the modal get added new event listeners on each row being deleted. This makes the page call all the event listeners and generates an error. This patch replaces the flawed logic (adding the event listener inside the event listener). It makes the event listener be defined at startup time, and make the .on('click') action just pass information around as required. To test: 1. Create at least 2 SMTP servers 2. Open the browser inspector, on the network tab 3. Click "Delete" for server 1 => SUCCESS: You get a successful message (OK) 4. Click "Delete" for server 2 => SUCCESS: You get a successful message (OK) => FAIL: You get also an alert message about server 1 (KO) => FAIL: The inspector shows more than one AJAX call has been made 5. Apply this patch and reload the page 6. Repeat 3-4 => SUCCESS: Everything goes smooth this time 7. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |master CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=27250 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114434|0 |1 is obsolete| | Attachment #114480|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 114484 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114484&action=edit Bug 27250: Fix stacked event listeners in SMTP delete modal There is a design issue on the click event listener that makes the modal get added new event listeners on each row being deleted. This makes the page call all the event listeners and generates an error. This patch replaces the flawed logic (adding the event listener inside the event listener). It makes the event listener be defined at startup time, and make the .on('click') action just pass information around as required. To test: 1. Create at least 2 SMTP servers 2. Open the browser inspector, on the network tab 3. Click "Delete" for server 1 => SUCCESS: You get a successful message (OK) 4. Click "Delete" for server 2 => SUCCESS: You get a successful message (OK) => FAIL: You get also an alert message about server 1 (KO) => FAIL: The inspector shows more than one AJAX call has been made 5. Apply this patch and reload the page 6. Repeat 3-4 => SUCCESS: Everything goes smooth this time 7. Sign off :-D Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jonathan.druart@bugs.koha-c |tomascohen@gmail.com |ommunity.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Nick Clemens <nick@bywatersolutions.com> 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=27250 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114484|0 |1 is obsolete| | --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 114569 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114569&action=edit Bug 27250: Fix stacked event listeners in SMTP delete modal There is a design issue on the click event listener that makes the modal get added new event listeners on each row being deleted. This makes the page call all the event listeners and generates an error. This patch replaces the flawed logic (adding the event listener inside the event listener). It makes the event listener be defined at startup time, and make the .on('click') action just pass information around as required. To test: 1. Create at least 2 SMTP servers 2. Open the browser inspector, on the network tab 3. Click "Delete" for server 1 => SUCCESS: You get a successful message (OK) 4. Click "Delete" for server 2 => SUCCESS: You get a successful message (OK) => FAIL: You get also an alert message about server 1 (KO) => FAIL: The inspector shows more than one AJAX call has been made 5. Apply this patch and reload the page 6. Repeat 3-4 => SUCCESS: Everything goes smooth this time 7. Sign off :-D Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|21.05.00 |21.05.00,20.11.01 released in| | --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Missing dependencies, not backported to 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27250 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org