mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
fixes #5438, multiple binding with alias
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7632 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
4f5a51d79d
commit
931d996d90
1 changed files with 4 additions and 4 deletions
|
@ -593,7 +593,7 @@ class Model extends Overloadable {
|
|||
$className = $assoc;
|
||||
}
|
||||
|
||||
if (!isset($this->{$assoc})) {
|
||||
if (!isset($this->{$assoc}) || $this->{$assoc}->name !== $className) {
|
||||
$model = array('class' => $className, 'alias' => $assoc);
|
||||
if (PHP5) {
|
||||
$this->{$assoc} = ClassRegistry::init($model);
|
||||
|
@ -1326,7 +1326,7 @@ class Model extends Overloadable {
|
|||
if (!$currentValidates = $this->__save($this, $record, $options)) {
|
||||
$validationErrors[$key] = $this->validationErrors;
|
||||
}
|
||||
|
||||
|
||||
if ($options['validate'] === 'only' || $options['validate'] === 'first') {
|
||||
$validating = true;
|
||||
if ($options['atomic']) {
|
||||
|
@ -1338,7 +1338,7 @@ class Model extends Overloadable {
|
|||
$validating = false;
|
||||
$validates = $currentValidates;
|
||||
}
|
||||
|
||||
|
||||
if (!$options['atomic']) {
|
||||
$return[] = $validates;
|
||||
} elseif (!$validates && !$validating) {
|
||||
|
@ -2234,7 +2234,7 @@ class Model extends Overloadable {
|
|||
!is_numeric($data[$fieldName])) && $validator['allowEmpty'] === false
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
if ($required) {
|
||||
$this->invalidate($fieldName, $message);
|
||||
if ($validator['last']) {
|
||||
|
|
Loading…
Reference in a new issue