Skip to content

Commit

Permalink
Merge pull request #383 from cakephp/revert-382-ADmad-patch-1
Browse files Browse the repository at this point in the history
Fix array expectation via cast.
  • Loading branch information
ADmad authored Nov 25, 2017
2 parents 6893ffe + d6750b2 commit fd7b991
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Shell/Task/ModelTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ public function fieldValidation($schema, $fieldName, array $metaData, $primaryKe
}
}

if (in_array($fieldName, $primaryKey)) {
if (in_array($fieldName, (array)$primaryKey)) {
$rules['allowEmpty'] = ['create'];
} elseif ($metaData['null'] === true) {
$rules['allowEmpty'] = [];
Expand Down

0 comments on commit fd7b991

Please sign in to comment.