When select export, I got the error:
warning: array_merge() [function.array-merge]: Argument #1 is not an array in
\drupal\includes\menu.inc on line 354.

warning: Cannot modify header information - headers already sent by (output started at \drupal\includes\common.inc:384) in \drupal\modules\taxonomy_xml\taxonomy_xml.module on line 102.

Some data has already been output to browser, can't send file

warning: Cannot modify header information - headers already sent by (output started at \drupal\includes\common.inc:384) in \drupal\modules\taxonomy_xml\taxonomy_xml.module on line 107.

warning: Cannot modify header information - headers already sent by (output started at \drupal\includes\common.inc:384) in \php\drupal\modules\taxonomy_xml\taxonomy_xml.module on line 108.

It is possible to fix:
In includes/menu.inc
around line 351
If I replace $arguments = array_merge($arguments, explode('/', $arg)); with:
if(is_array($arguments)) {
$arguments = array_merge($arguments, explode('/', $arg));
}
Then everything is fine.

Is it a bug on the Durpal core engine?

Comments

mahtin’s picture

I also had the same issues, but I think I would recommend the following changes to your patch..

  if (strlen($arg)) {
    if(is_array($arguments)) {
      $arguments = array_merge($arguments, explode('/', $arg));
    } else {
      $arguments = explode('/', $arg);
    }
  }

...it's for the same place, ie: ~ line 350 includes/menu.inc . The change makes sure that $arg is always used.

However, I don't see how the initial error ever happens, as line 348 has this...

  $arguments = array_key_exists('callback arguments', $menu['items'][$mid]) ? $menu['items'][$mid]['callback arguments'] : array();

...and hence the $arguments variable is always an array.

The good news is that a valid XML file is being produced.

sami_k’s picture

Status: Active » Closed (fixed)

Doesn't seem to be an issue with the module..