From ca59191d5cd7e5303b934ced281af9d6d7211780 Mon Sep 17 00:00:00 2001 From: Jan Ptacek Date: Mon, 30 Jul 2018 11:17:24 +0200 Subject: [PATCH] Avoid undefined index: null Avoid Notice (8): Undefined index: null [APP/Vendor/cakephp/cakephp/lib/Cake/Model/Datasource/DboSource.php, line 1013] also discussed here: https://github.com/cakephp/cakephp/commit/22b0275a58cadc7548f5904cf588e44b073eb0cd#diff-b8a4043bec5d20830b77d240ae8fdef5R2087 --- lib/Cake/Model/Datasource/DboSource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 7c4c8151c..598af553f 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -1076,7 +1076,7 @@ class DboSource extends DataSource { for ($i = 0; $i < $count; $i++) { $schema = $Model->schema(); - $valueInsert[] = $this->value($values[$i], $Model->getColumnType($fields[$i]), isset($schema[$fields[$i]]) ? $schema[$fields[$i]]['null'] : true); + $valueInsert[] = $this->value($values[$i], $Model->getColumnType($fields[$i]), isset($schema[$fields[$i]]['null']) ? $schema[$fields[$i]]['null'] : true); $fieldInsert[] = $this->name($fields[$i]); if ($fields[$i] === $Model->primaryKey) { $id = $values[$i];