Skip to content
Permalink
Browse files

Fix warning with FormHelper::inputs()

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 c77c7a734739aa7a099bbb60c36c974e35450bb3
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/View/Helper/FormHelper.php
@@ -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)) {

0 comments on commit c77c7a7

Please sign in to comment.
You can’t perform that action at this time.