Clearing HABTM (unique) when HABTM array is empty, refs

This commit is contained in:
Jeremy Harris 2014-08-28 17:49:30 -05:00
parent 4922729432
commit 2dac6d29c2
3 changed files with 47 additions and 1 deletions
lib/Cake/Model

View file

@ -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]);