PHP Fatal error: Unsupported operand types in .../sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc on line 230, referer: .../admin/build/pages/add

The line causing the error is: $form_info['forms'] += $handler_plugin['forms'];

The value for $handler_plugin['forms'] is empty in this case. I have done a temporary hack to get around the error by changing that line to:

if (!empty($handler_plugin['forms'])) {
$form_info['forms'] += $handler_plugin['forms'];
}

I am not sure what value is supposed to be in $handler_plugin['forms'] but it seems that the '+=' operator is not appropriate here considering that $form_info['forms'] is an array.

Comments

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

It would help a lot if you would tell me what it is you did to get this error.

cthamer’s picture

Sorry about that. I tried to add a new custom page from /admin/build/pages/add.

I didn't do anything special. I just set the title, machine name, description and path. After clicking continue I end up with a blank page due to the PHP fatal error.

nobarte’s picture

I had the same problem because I created new custom page without any variant type.
To get variant type, you have to install module which provide variant type, for example: panels.

timb’s picture

I ran into this also. I had just installed Chaos tools 6.x-1.2 and Page Manager.

When I try to add a new page @ /admin/build/pages/add I get the error:
warning: Invalid argument supplied for foreach() in {/////}/includes/form.inc on line 1428.
and the variant type pulldown is empty. Continuing to fill in the form and submit it results in the error described in the original issue.

Additionally the Invalid Argument warning can be generated by attempting to edit any of the default pages.

I will attempt to install Panels tommorrow and will report back if it solves the problem as reported above. If it does so, shouldn't the Page Manager module be listed as dependent on Panels?

merlinofchaos’s picture

Status: Postponed (maintainer needs more info) » Active

timb #4: That happens because you don't have Panels installed, and right now no module is offering a variant that isn't a panel. It probably should be modified to be a little smarter about letting you know this situation is bad.

timb’s picture

Thanks for the reply. I got it going once panels was in place and was having so much fun that I forgot to finish my post.

Thanks, merlinofchaos, for the terrific module. I will try to pitch in a little documentation as I go along.

merlinofchaos’s picture

Priority: Critical » Normal
Status: Active » Fixed

This wasn't really critical but it was a bad thing to do to unsuspecting users. Fixed. in CVS.

Status: Fixed » Closed (fixed)

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