I get a error when I visit certain URL's like: node/add/blog or: civicrm/user

Fatal error: Unsupported operand types in /home/ps/prostaker/includes/common.inc on line 1542

Is the error I get when going to those URL's. I havent performed any major changes in the theme - Im using a subtheme from zen's starter kit, and I tried my drupal installation with 2 different themes where I dont run into this error; garland and a custom made theme works good. I run drupal 6.12 with quite a lot of modules.

Would be grateful for some advice here.

Regards

Comments

Grayside’s picture

I appear to have nearly the same problem on my one site with Zen.

PHP Fatal error: Unsupported operand types in /home/drupal/drupal-6.14/includes/common.inc on line 1416

Line 1416 is the very last line of the following block, based on other 5.3 errors, I'm thinking it is the "+=" assignment of an array.

function url($path = NULL, $options = array()) {
  // Merge in defaults.
  $options += array(
    'fragment' => '',
    'query' => '',
    'absolute' => FALSE,
    'alias' => FALSE,
    'prefix' => ''
  );

Checking the Zen codebase for url() calls, a quick search turned up zen/template.theme-registry.inc on line 33, but removing the url() call did not appear to change anything.

Commenting out the merging code eliminates the error. (And exposes all the non-Zen PHP 5.3 troubles!)

EDIT: An even *better* core hack to fix this:

function url($path = NULL, $options = array()) {
  // Merge in defaults.
  $options += array( 'fragment' => '',
    'query' => '',
    'absolute' => FALSE,
    'alias' => FALSE,
    'prefix' => ''
  );

The first array element is in the same line as the array declaration.

int’s picture

Project: Zen » Drupal core
Version: 6.x-1.0 » 6.15
Component: PHP Code » base system

I have the same error when i visit /admin/help page

Fatal error: Unsupported operand types in /(...)/includes/common.inc on line 1416

change this: (common.inc start line 1410)

   $options += array(
     'fragment' => '',
     'query' => '',
     'absolute' => FALSE,
     'alias' => FALSE,
     'prefix' => ''
   );

to this:

    $options['fragment'] = "";
    $options['query'] = "";
    $options['absolute'] = FALSE;
    $options['alias'] = FALSE;
    $options['prefix'] = "";
Anonymous’s picture

The above hack breaks flag's links:
Parameter 1 to flag_flag_link() expected to be a reference, value given in ***/includes/module.inc on line 462.

madwalo’s picture

i did this:

if(is_array($options)){
$options += array(
'fragment' => '',
'query' => '',
'absolute' => FALSE,
'alias' => FALSE,
'prefix' => ''
);
}

darkodev’s picture

Using the debug_print_backtrace() trick from http://justinhileman.info/articles/unsupported-operand-types-in-drupal-6x, I found that flag module was breaking url() with a null argument:

#0 url(, ) called at [/home/cjbs/public_html_new/trunk/sites/all/modules/flag/flag.module:1092

Implementing #5 above works.

Now to find why flag module is broken all of a sudden so I can remove the core hack . . .

dpearcefl’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Do you still need help?

dpearcefl’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Active
omar alahmed’s picture

#5 works perfectly, thanks very much.

dpearcefl’s picture

Project: Drupal core » Flag
Version: 6.15 » 6.x-1.1
Component: base system » Flag core
Priority: Major » Normal
Status: Active » Closed (duplicate)

This is not really an issue with Drupal core but is a problem with the Flag module (see #6).

This issue duplicates this issue: #459994: Crash when rendering url() (PHP 5.3 compatibility)