Skip to content

Commit

Permalink
Fix warning with FormHelper::inputs()
Browse files Browse the repository at this point in the history
introspectModel() can return non-array data sometimes. Casting avoids
warnings when forms are generate for models with no or faulty schema()
methods.

Refs #3602
  • Loading branch information
markstory committed Apr 10, 2013
1 parent 0e646a2 commit c77c7a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/FormHelper.php
Expand Up @@ -845,7 +845,7 @@ public function inputs($fields = null, $blacklist = null, $options = array()) {
$modelFields = array();
$model = $this->model();
if ($model) {
$modelFields = array_keys($this->_introspectModel($model, 'fields'));
$modelFields = array_keys((array)$this->_introspectModel($model, 'fields'));
}
if (is_array($fields)) {
if (array_key_exists('legend', $fields) && !in_array('legend', $modelFields)) {
Expand Down

0 comments on commit c77c7a7

Please sign in to comment.