mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 10:36:16 +00:00
fixes #6506, notice on 5.2.10 for habtm save with empty value
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8251 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
93d64c4e76
commit
30281d6c59
1 changed files with 3 additions and 3 deletions
|
@ -372,7 +372,7 @@ class Model extends Overloadable {
|
|||
} elseif ($table) {
|
||||
$this->useTable = $table;
|
||||
}
|
||||
|
||||
|
||||
if ($ds !== null) {
|
||||
$this->useDbConfig = $ds;
|
||||
}
|
||||
|
@ -827,7 +827,7 @@ class Model extends Overloadable {
|
|||
$type = $this->getColumnType($field);
|
||||
|
||||
if (in_array($type, array('datetime', 'timestamp', 'date', 'time'))) {
|
||||
$useNewDate = (isset($data['year']) || isset($data['month']) ||
|
||||
$useNewDate = (isset($data['year']) || isset($data['month']) ||
|
||||
isset($data['day']) || isset($data['hour']) || isset($data['minute']));
|
||||
|
||||
$dateFields = array('Y' => 'year', 'm' => 'month', 'd' => 'day', 'H' => 'hour', 'i' => 'min', 's' => 'sec');
|
||||
|
@ -1343,7 +1343,7 @@ class Model extends Overloadable {
|
|||
unset($values);
|
||||
} elseif (isset($row[$this->hasAndBelongsToMany[$assoc]['associationForeignKey']])) {
|
||||
$newData[] = $row;
|
||||
} elseif (isset($row[$join][$this->hasAndBelongsToMany[$assoc]['associationForeignKey']])) {
|
||||
} elseif (isset($row[$join]) && isset($row[$join][$this->hasAndBelongsToMany[$assoc]['associationForeignKey']])) {
|
||||
$newData[] = $row[$join];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue