mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-06-15 11:13:36 +00:00
Clearing HABTM (unique) when HABTM array is empty, refs #2461
This commit is contained in:
parent
4922729432
commit
2dac6d29c2
3 changed files with 47 additions and 1 deletions
lib/Cake/Model
|
@ -1201,6 +1201,10 @@ class Model extends Object implements CakeEventListener {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!isset($this->data[$modelName])) {
|
||||
$this->data[$modelName] = array();
|
||||
}
|
||||
|
||||
foreach ($fieldSet as $fieldName => $fieldValue) {
|
||||
unset($this->validationErrors[$fieldName]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue