When run any simpletest (CCK, Date, whatever), fatal error appears.
( ! ) Fatal error: Unsupported operand types in trunk/src/includes/form.inc on line 518
14 9.2590 11361864 drupal_prepare_form( $form_id = 'admin_block_theme_form', $form = array ('theme_default' => array ('#type' => 'radios', '#options' => array ('garland' => 'Garland'), '#default_value' => 'garland'), 'submit' => array ('#type' => 'submit', '#value' => 'Save configuration'), '#submit' => array (0 => 'system_settings_form_submit'), '#parameters' => array (0 => 'admin_block_theme_form', 1 => array ('storage' => NULL, 'submitted' => FALSE, 'post' => array (...)), 2 => array ('doc' => class stdClass { ... }, 'cube' => class stdClass { ... }, 'rubik' => class stdClass { ... }, 'tao' => class stdClass { ... }, 'zen' => class stdClass { ... }, 'bluemarine' => class stdClass { ... }, 'chameleon' => class stdClass { ... }, 'marvin' => class stdClass { ... }, 'minnelli' => class stdClass { ... }, 'pushbutton' => class stdClass { ... }, 'garland' => class stdClass { ... })), '#build_id' => 'form-fd164b19f060570a3694c0823d3c8770', '#type' => 'form', '#programmed' => FALSE, 'form_build_id' => array ('#type' => 'hidden', '#value' => 'form-fd164b19f060570a3694c0823d3c8770', '#id' => 'form-fd164b19f060570a3694c0823d3c8770', '#name' => 'form_build_id'), '#token' => 'admin_block_theme_form', 'form_token' => array ('#id' => 'edit-admin-block-theme-form-form-token', '#type' => 'token', '#default_value' => '85aa4711df708c72607990b28221f935'), 'form_id' => array ('#type' => 'hidden', '#value' => 'admin_block_theme_form', '#id' => 'edit-admin-block-theme-form'), '#id' => 'admin-block-theme-form'), $form_state = array ('storage' => NULL, 'submitted' => FALSE, 'post' => array ()) )
$form_id = string 'admin_block_theme_form' (length=22)
Comments
Comment #1
kenorb commentedDisabling admin module solve the problem.
Tested on Pressflow 6.16 if this does matter.
Comment #2
webchickHm. I'm getting this too, but on a site that doesn't seem to have Admin module.
It is running Pressflow 6.17, however.
Comment #3
webchickHere's my stack dump from XDdebug:
( )
Comment #4
webchickThis error appears to be theme-related here (thanks for the nice 620 (!) second delay in the theme() function above for the clue :P). When I switched my front-end theme from a custom one to Garland, not only did the test finish in about 1/1000th of the time, but it didn't have this fatal error issue. Curious...
Comment #5
zroger commentedI noticed the same problem as kenorb with admin module on Pressflow 6.16 - http://img.skitch.com/20100715-grx663um19j1j3ewc434fg6stm.jpg
I tried webchicks advice to switch the front-end theme to garland, but ended up with the same results. It does seem to be a theme related problem, since like webchick I'm seeing a large amount of time spent in theme(). btw, that theme() function on line 5 is theme('page').
EDIT: I forgot to mention that the error goes away after disabling admin module.
Comment #6
Steven Merrill commentedDon't have time to bring this one home yet, but it's definitely devel module. Disable it and all will be well.
(I do want to fix this, though, since both Admin module and SimpleTest rate highly in Drupal things that are very good.)
Comment #7
Steven Merrill commentedOh. Hrm. It's devel in _our_ case. May not be for everyone.
Comment #8
kenorb commentedFor those who using Pressflow, please upgrade to 6.17.85. Problem should be fixed.
Comment #9
Steven Merrill commentedI can confirm that a Pressflow version upgrade fixed the issue.
Comment #10
kenorb commentedComment #11
arithmetric commentedI'm still encountering this error with Pressflow version 6.17.85. However, I was able to trace the error and found a potential solution.
The following code (line 518 of form.inc) fails because $form is an array and in some cases _element_info('form') does not return an array.
When this happens, module_implements('elements') in _element_info() has returned no instance of hook_elements(), which in turn happens when only the set of bootstrap-mode modules are registered as loaded.
I think this list of registered modules is incorrectly reset to the bootstrap subset when module_list(TRUE) is called (instead of module_list(TRUE, FALSE) for Drupal 6) in DrupalWebTestCase::tearDown().
I've attached a patch that makes this change, and it resolves this error for me.
Comment #12
tom_o_t commentedPatch in #11 fixes this problem for me.
Comment #13
boombatower commentedTo be included in #890440: Backport latest SimpleTest code from D7.
Comment #14
kenorb commentedSimilar issue using Simpletest 6.x-2.10 with Pressflow 6.20.97:
#1101304: Fatal error: Unsupported operand types in form.inc on line 524 (Pressflow)
Where patch #11 works as well, but not: #890440: Backport latest SimpleTest code from D7
Comment #15
domidc commentedI confirm the same error on pressflow 6.20 and simpletest 6.x-2.0 and patch #11 works
Comment #16
kenorb commentedNot duplicate, because nothing works from mentioned ticket and it's for 7.x
Attached patch against the lastest 6.x.
Comment #17
kenorb commentedAnybody can test with PHP 5.3.x instead of 5.2.x if this error appears?
With PHP 5.3.x I don't see this error.
Comment #18
jhedstromI'm seeing this error using php 5.3, and the patch in #16 resolves it.
Comment #19
dave reidI don't get the same bug using PHP 5.3 and fresh 6.x core without the patch.
Comment #20
arithmetric commented@Dave Reid: Did you test with Pressflow? This issue seems to be most often reported with a Pressflow install.
Comment #21
dave reidSo...wouldn't it need to be fixed in Pressflow then?
Comment #22
jhedstromSimpletest for Drupal 6.x is not part of core, while Pressflow only patches core.
Comment #23
dave reidBacktracking... it makes sense to do the same thing that module_enable() does.
Comment #24
jhedstromActually, I forgot that SimpleTest is distributed as part of Pressflow. However, I think it should still be fixed here, since a Pressflow site running this module out of sites/all or out of an installation profile directory would still get this bug.
Comment #25
dave reidFixed in Git with http://drupalcode.org/project/simpletest.git/commit/17c0555