mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Merge pull request #770 from nicolas-lescop/patch-2
Delete all selected related elements and not just the first element
This commit is contained in:
commit
0c5c03c14c
@ -505,8 +505,9 @@ class RelationController extends ControllerBehavior
|
||||
$this->beforeAjax();
|
||||
|
||||
if (($checkedIds = post('checked')) && is_array($checkedIds)) {
|
||||
$relatedModel = $this->relationObject->getRelated();
|
||||
foreach ($checkedIds as $relationId) {
|
||||
if (!$obj = $this->relationObject->find($relationId)) {
|
||||
if (!$obj = $relatedModel->find($relationId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user