Bug 17916 - "Delete MARC modification template" fails to actually delete it
Summary: "Delete MARC modification template" fails to actually delete it
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
: 18619 (view as bug list)
Depends on: 16148
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-16 18:01 UTC by John Sterbenz
Modified: 2017-12-07 22:20 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17916 - "Delete MARC modification template" fails to actually delete it (3.05 KB, patch)
2017-04-25 13:23 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17916 - "Delete MARC modification template" fails to actually delete it (3.15 KB, patch)
2017-04-25 13:44 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 17916 - "Delete MARC modification template" fails to actually delete it (3.22 KB, patch)
2017-04-25 13:51 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description John Sterbenz 2017-01-16 18:01:18 UTC
As of 16.11.00 on Ubuntu 14.04, attempting to delete a MARC modification template (Tools > MARC Modification templates) does not work.  A change to the MARC modification template interface was noted in the upgrade to 16.11.x from 16.05.x, where the functionality did work correctly (as it had in any release used since 3.18)

VERIFY:
*Upon selecting "Delete" for the appropriate template, system will prompt "Are you sure you wish to delete this template action" (select "OK") and then "Are you sure you wish to delete this template" (select "OK" again).  There is no response by the system after this final "OK".  The screen is not refreshed as expected and the template remains in place, fully intact with no changes as though no action had been taken.  

NOTES:
*The "Are you sure you wish to delete this template action" prompt seems out of place given the goal of deleting the entire template, not just a single element therein.
*Problem exists for both modification templates carried forward from other koha releases as well as for templates created "new" in 16.11.
*"Edit actions" and "Duplicate" functions appear to work without issue.
*User confirmed to have superlibrarian privileges.
*PC running Chrome 55.0.x on Win7 Enterprise, though also confirmed in Firefox 50.1.0
Comment 1 Katrin Fischer 2017-01-17 22:43:06 UTC
I can reproduce this bug on current master. Deleting single actions work, deleting a whole template asks twice, doesn't delete.
Comment 2 Owen Leonard 2017-04-25 13:23:45 UTC
Created attachment 62676 [details] [review]
Bug 17916 - "Delete MARC modification template" fails to actually delete it

The MARC modification templates' 'Delete' button fails because the event
handler has a "preventDefault" but the outcome of the confirmation
function must return true or false.

This patch removes the "preventDefault" from the .delete_template click
handler as well as a redundant onclick attribute from the delete link
itself.

To test, apply the patch and go to Tools -> MARC modification templates.
Clicking the delete button for any existing template should work
correctly.
Comment 3 Alex Buckley 2017-04-25 13:44:46 UTC
Created attachment 62680 [details] [review]
Bug 17916 - "Delete MARC modification template" fails to actually delete it

The MARC modification templates' 'Delete' button fails because the event
handler has a "preventDefault" but the outcome of the confirmation
function must return true or false.

This patch removes the "preventDefault" from the .delete_template click
handler as well as a redundant onclick attribute from the delete link
itself.

To test, apply the patch and go to Tools -> MARC modification templates.
Clicking the delete button for any existing template should work
correctly.

Followed test plan, worked as intended

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Comment 4 Jonathan Druart 2017-04-25 13:51:47 UTC
Created attachment 62681 [details] [review]
Bug 17916 - "Delete MARC modification template" fails to actually delete it

The MARC modification templates' 'Delete' button fails because the event
handler has a "preventDefault" but the outcome of the confirmation
function must return true or false.

This patch removes the "preventDefault" from the .delete_template click
handler as well as a redundant onclick attribute from the delete link
itself.

To test, apply the patch and go to Tools -> MARC modification templates.
Clicking the delete button for any existing template should work
correctly.

Followed test plan, worked as intended

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Kyle M Hall 2017-04-28 11:02:30 UTC
Pushed to master for 17.05, thanks Owen!
Comment 6 Katrin Fischer 2017-05-13 12:20:53 UTC
This patch has been pushed to 16.11.x and will be in 16.11.08.

Small conflict in the template.
Comment 7 Jens Weber 2017-05-22 07:54:09 UTC
*** Bug 18619 has been marked as a duplicate of this bug. ***
Comment 8 Mason James 2017-05-23 23:36:41 UTC
> As of 16.11.00 on Ubuntu 14.04, attempting to delete a MARC modification
> template (Tools > MARC Modification templates) does not work.  A change to
> the MARC modification template interface was noted in the upgrade to 16.11.x
> from 16.05.x, where the functionality did work correctly (as it had in any
> release used since 3.18)

skipping for 16.05.x series