Skip to content

Commit 2570e3c

Browse files
committed
Confirm that the modal is hidden
1 parent fc2c598 commit 2570e3c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

client/js/ManyField.src.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@
157157
body.html('');
158158

159159
form.parents('.modal').modal('hide');
160+
$('body').removeClass('modal-open');
161+
$('.modal-backdrop').remove();
160162

161163
$('body').trigger('manyFormModalSaved', {
162164
form

src/ManyField.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public function recordForm()
399399
$request = Controller::curr()->getRequest();
400400

401401
if (!SecurityToken::inst()->checkRequest($request)) {
402-
return Controller::curr()->httpError(400);
402+
return Controller::curr()->httpError(400, 'Missing security token');
403403
}
404404

405405
$index = Controller::curr()->getRequest()->getVar('RecordID');
@@ -411,7 +411,7 @@ public function recordForm()
411411

412412
$record = $class::get()->byId($index);
413413

414-
if (!$record || !$record->canDelete()) {
414+
if (!$record || !$record->canEdit()) {
415415
return Controller::curr()->httpError(400);
416416
}
417417

0 commit comments

Comments
 (0)