The JS in the browse.blade template replaces the __id string with the id of the item of the clicked delete button, if I click cancel, the delete_form action still contains the id of that item even if I click the delete button of an another item, the delete_form is still containing the old id and its action is not updated with the new id.
I'm assigning myself to this :D I'll send the commit later
Edit: sent #697
I added this as a temporary solution :D
$('button:contains("Cancel")').on('click', function () {
window.location.reload();
});
Good luck.
This was fixed inside /tcg/voyager/resources/views/bread/browse.blade.php but wasn't copied to /resources/views/vendor/voyager/posts/browse.blade.php
Simply replace the click function in posts/browse.blade.php to:
$('td').on('click', '.delete', function (e){
var form = $('#delete_form')[0];
form.action = parseActionUrl(form.action, $(this).data('id'));
$('#delete_modal').modal('show');
});
function parseActionUrl(action, id) {
return action.match(/\/[0-9]+$/)
? action.replace(/([0-9]+$)/, id)
: action + '/' + id;
}
I won't make a PR since, you have assigned it to yourself.
We are getting rid of those views (posts/* and users/*) in next version, so they use default BREAD views.
And the posts BREAD will probably be moved to a plugin/hook
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.