You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And in the code we can see that the key 0 is required in deleteWithRelated and restoreWithRelated methods, that calls something like: $error = !$this->{$data['name']}[0]->updateAll($this->_rt_softdelete, ['and', $array]);
I have an relation with alphanumeric keys, which doesn't have a numerical index and gives a index not defined error.
In order to solve it, I made a change to access the array data like the following:
array_values($this->{$data['name']})[0]
This approach is only valid to PHP 5.4+ though.
The text was updated successfully, but these errors were encountered:
As mentioned in the description of the extension, the hasMany relation array must have numerical keys:
And in the code we can see that the key 0 is required in
deleteWithRelated
andrestoreWithRelated
methods, that calls something like:$error = !$this->{$data['name']}[0]->updateAll($this->_rt_softdelete, ['and', $array]);
I have an relation with alphanumeric keys, which doesn't have a numerical index and gives a index not defined error.
In order to solve it, I made a change to access the array data like the following:
This approach is only valid to PHP 5.4+ though.
The text was updated successfully, but these errors were encountered: