Skip to content

Commit

Permalink
bug #4150 Inject delete form action on detail pages (notFloran)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.0.x-dev branch.

Discussion
----------

Inject delete form action on detail pages

Same as #4138, the delete form was broken on detail pages.

Commits
-------

b540207 Inject delete form action on detail pages
  • Loading branch information
javiereguiluz committed Jan 22, 2021
2 parents b0b5e1a + b540207 commit 4c4ca86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Resources/views/crud/detail.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@
$(function() {
$('.action-delete').on('click', function(e) {
e.preventDefault();
const formAction = $(this).attr('formaction');
$('#modal-delete').modal({ backdrop: true, keyboard: true })
.off('click', '#modal-delete-button')
.on('click', '#modal-delete-button', function () {
$('#delete-form').trigger('submit');
$('#delete-form').attr('action', formAction).trigger('submit');
});
});
});
Expand Down

0 comments on commit 4c4ca86

Please sign in to comment.