Closed (fixed)
Project:
Drupal core
Version:
6.20
Component:
forms system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2011 at 23:53 UTC
Updated:
20 Apr 2012 at 06:19 UTC
We get this error when attempting to edit Any node. Not sure why it popped, haven't modded any core files, and have a sneaking suspicion that SEOtools may have something to do with it, but can't prove it.
Any ideas?
Comments
Comment #1
comparellc commentedLine 991-993:
if (!empty($form['#disabled'])) {
$form['#attributes']['disabled'] = 'disabled';
}
This is the real drupal core form.inc. Why is this being thrown? I have very little experience in finding bugs, but I'm fairly sure this is something new..
Comment #2
dyesdyes commentedi had the same error. It was a syntax error in the form_alter. ($form['redirect'] instead of $form['#redirect'])
Hope it will help someone.
Comment #3
darrellduane commentedThanks, this was helpful. I didn't have quite the same problem but it was an issue with my $form definition.
Comment #4
sam_habib commentedI am having the same issue. I did not edit any of the code in any of the modules and all of a sudden I get this message !!!
Comment #5
damien tournoud commentedThis means that the form definition is severely incorrect somehow.
Comment #6
millenniumtreeHad this same error message.
In my case, I had named one of my block functions (that returns HTML text)
my_module_name_search()So essentially, Drupal saw this as a 'hook_search' function and tried to use the return value as a $form object. Since it was a string, not a $form object, it died but ONLY on the search administration page.
Moral of the story - don't name your functions as a hook.
Since this module was written, I've taken to prefixing all non-hook functions with an underscore.
Comment #7
luizcarcerelli commentedMy case was similar to millenniumtree. I umcomented some lines in galleria.module file wich implemente hook_form_alter and the error cames only in some pages (edit story content type for example).
Tank you vary much.
Comment #8
kerasai commentedHopefully this helps someone in the future.
I ran into this in my hook_menu when using 'drupal_get_form' as the page callback and array('mymodule_some_form', 4) as the page arguments. The function definition of mymodule_some_form was as follows:
mymodule_some_form($form, $object_loaded_from_path_arg)I get the error when tacking extra info onto $form like this:
$form['some_item'] = array(...)I solved the issue by setting $form back to an empty array then putting my data into it. It must have had something funky in it (or possibly it was something that I shouldn't have been using) that caused the error.
Comment #9
feng-shui commentedCheers
Comment #10
tutumlum commentedThanks a lot!!!!!! for #8
Comment #11
kars-t commentedPlease close solved issues :)
Comment #13
orjantorang commentedI had for some reason switched places between the arguments $form_state and argument 2 in a hook_form causing the function to manipulate the $form_state, resulting in the "Fatal error: Cannot use string offset as an array..."