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();
|
$this->beforeAjax();
|
||||||
|
|
||||||
if (($checkedIds = post('checked')) && is_array($checkedIds)) {
|
if (($checkedIds = post('checked')) && is_array($checkedIds)) {
|
||||||
foreach ($checkedIds as $relationId) {
|
$relatedModel = $this->relationObject->getRelated();
|
||||||
if (!$obj = $this->relationObject->find($relationId)) {
|
foreach ($checkedIds as $relationId) {
|
||||||
|
if (!$obj = $relatedModel->find($relationId)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user