Avoid undefined index: null (update action)

Avoid Notice (8): Undefined index: null [APP/Vendor/cakephp/cakephp/lib/Cake/Model/Datasource/DboSource.php, line 2180]
also discussed here: 22b0275#diff-b8a4043bec5d20830b77d240ae8fdef5R2087
fix for previous instance if same bug already merged here: cakephp#12411
(sorry for overlooking this second use-case :( )
This commit is contained in:
Jan Ptacek 2018-08-06 12:15:41 +02:00 committed by GitHub
parent 1f1cd775c1
commit d292a83407
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2177,7 +2177,7 @@ class DboSource extends DataSource {
$update = $quoted . ' = ';
if ($quoteValues) {
$update .= $this->value($value, $Model->getColumnType($field), isset($schema[$field]) ? $schema[$field]['null'] : true);
$update .= $this->value($value, $Model->getColumnType($field), isset($schema[$field]['null']) ? $schema[$field]['null'] : true);
} elseif ($Model->getColumnType($field) === 'boolean' && (is_int($value) || is_bool($value))) {
$update .= $this->boolean($value, true);
} elseif (!$alias) {