mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing issues in ContainableBehavior that could leave models unbound when 'fields' was used as part of containment conditions. Fixes #253
This commit is contained in:
parent
dd0c4a64c5
commit
6db91b0f49
2 changed files with 2 additions and 2 deletions
|
@ -155,7 +155,7 @@ class ContainableBehavior extends ModelBehavior {
|
|||
if (!$reset && empty($instance->__backOriginalAssociation)) {
|
||||
$instance->__backOriginalAssociation = $backupBindings;
|
||||
} else if ($reset) {
|
||||
$instance->__backAssociation[$type] = $instance->{$type};
|
||||
$instance->__backAssociation[$type] = $backupBindings[$type];
|
||||
}
|
||||
$instance->{$type}[$assoc] = array_merge($instance->{$type}[$assoc], $model['keep'][$assoc]);
|
||||
}
|
||||
|
|
|
@ -3390,7 +3390,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
)
|
||||
));
|
||||
$this->assertEqual($expected, $this->Article->User->hasOne);
|
||||
|
||||
|
||||
$this->Article->User->bindModel($userHasOne, false);
|
||||
$expected = $this->Article->User->hasOne;
|
||||
$this->Article->find('all', array(
|
||||
|
|
Loading…
Add table
Reference in a new issue