Skip to content

Commit

Permalink
Avoid undefined index: null (update action)
Browse files Browse the repository at this point in the history
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: #12411
(sorry for overlooking this second use-case :( )
  • Loading branch information
ptica committed Aug 6, 2018
1 parent 1f1cd77 commit d292a83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -2177,7 +2177,7 @@ protected function _prepareUpdateFields(Model $Model, $fields, $quoteValues = tr
$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) {
Expand Down

0 comments on commit d292a83

Please sign in to comment.