I am getting this error after applying changes generated with formupdater (http://drupal.org/node/37457) to several modules (latest cvs of article, arooga, fckeditor, im (instant messenger)):
Fatal error: Cannot create references to/from string offsets nor overloaded objects in drupal\includes\form.inc on line 312
I'm uncertain as to whether this is a problem with changes made by formupdater or the code in form.inc.
Prior to applying formupdater changes I would get the error (an example from the article module error):
Call to undefined function: form_select() in drupal\modules\article\article.module on line 119
These errors occur after installing the modules and entering settings (eg. admin -> settings -> article)
Alex
Comments
Comment #1
thomherfs commentedUpdate to the latest form.inc in CVS and see if that corrects your problem. It was just uploaded a few hours ago.
Some of mine went away, but not all of them. The problem appears to still be there.
Comment #2
chx commentedThis means that a # is missing. You shoild ifnd out which one. Some regexp searching will show it quick...
Comment #3
jaxxed commentedYes it is a missing # in one of the elemnt attributes. It is caused when the form component tries to build a parent list/tree for an element, considering that sub/lower elements in a group are array elements that sit parrallel to the element attributes:
consider that:
$form['group']= array(
'#type' => 'fieldset',
'#title' => t(Form Group'),
'#tree' => TRUE
);
$form['group'][markup'] = array(
'#type' => 'markup',
'#value' => 'My Markup Here'
);
is the same as:
$form['group'] = array(
'#type' => 'fieldset',
'#title' => t('Form Group'),
'#tree' => TRUE,
'markup' => array(
'#type' => 'markup',
'#value' => 'My Markup Here'
)
);
And as such it is logical to assume that any attributes missing the # prefix are at some point treated as children elements, but are improperly configured (usually string instead of array value). This can cause bad behaviour with string values or also for array values such as the '#type'=>'select' #options attribute (which is an array of options for which there are no '#' prefixed keys.
I haven't looked further but I can imagine that improper use of '#tree' and '#type'=>'fieldset' might also be a culprit (any time you are implying a parent/child reference.)