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

kenorb’s picture

Disabling admin module solve the problem.
Tested on Pressflow 6.16 if this does matter.

webchick’s picture

Hm. I'm getting this too, but on a site that doesn't seem to have Admin module.

It is running Pressflow 6.17, however.

webchick’s picture

Here's my stack dump from XDdebug:


( ! ) Fatal error: Unsupported operand types in /Users/webchick/Sites/grammy365.com/trunk/public_html/includes/form.inc on line 518
Call Stack
# Time Memory Function Location
1 0.0004 63312 {main}( ) ../index.php:0
2 0.4167 30377988 menu_execute_active_handler( ) ../index.php:18
3 0.4239 30969440 call_user_func_array
( )
../menu.inc:348
4 0.4239 30969668 system_batch_page( ) ../menu.inc:0
5 620.0786 40177832 theme( ) ../system.admin.inc:1834
6 620.0787 40183692 call_user_func_array( ) ../theme.inc:697
7 620.0787 40184032 template_preprocess_page( ) ../theme.inc:0
8 620.3037 41079112 drupal_get_form( ) ../theme.inc:1868
9 620.3040 41083068 drupal_prepare_form( ) ../form.inc:105

webchick’s picture

This 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...

zroger’s picture

I 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.

Steven Merrill’s picture

Don'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.)

Steven Merrill’s picture

Oh. Hrm. It's devel in _our_ case. May not be for everyone.

kenorb’s picture

For those who using Pressflow, please upgrade to 6.17.85. Problem should be fixed.

Steven Merrill’s picture

I can confirm that a Pressflow version upgrade fixed the issue.

kenorb’s picture

Status: Active » Fixed
arithmetric’s picture

Project: Admin » SimpleTest
Version: 6.x-2.0-beta2 » 6.x-2.x-dev
Status: Fixed » Needs review
StatusFileSize
new537 bytes

I'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.

$form += _element_info('form');

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.

tom_o_t’s picture

Patch in #11 fixes this problem for me.

boombatower’s picture

Status: Needs review » Closed (duplicate)
kenorb’s picture

Similar 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

domidc’s picture

I confirm the same error on pressflow 6.20 and simpletest 6.x-2.0 and patch #11 works

kenorb’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new447 bytes

Not duplicate, because nothing works from mentioned ticket and it's for 7.x
Attached patch against the lastest 6.x.

kenorb’s picture

Anybody 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.

jhedstrom’s picture

I'm seeing this error using php 5.3, and the patch in #16 resolves it.

dave reid’s picture

I don't get the same bug using PHP 5.3 and fresh 6.x core without the patch.

arithmetric’s picture

@Dave Reid: Did you test with Pressflow? This issue seems to be most often reported with a Pressflow install.

dave reid’s picture

So...wouldn't it need to be fixed in Pressflow then?

jhedstrom’s picture

Simpletest for Drupal 6.x is not part of core, while Pressflow only patches core.

dave reid’s picture

Backtracking... it makes sense to do the same thing that module_enable() does.

jhedstrom’s picture

Actually, 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.

dave reid’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.