Whenever I want to create a container or a forum it warns me :

warning: array_merge_recursive() [function.array-merge-recursive]: recursion detected in /home/mydomain/includes/module.inc on line 473.

Comments

neclimdul’s picture

Could not reproduce. could you give us some more information. maybe module list?

pictogram’s picture

StatusFileSize
new4.56 KB

Sure,

All core optionals except :
- blog api
- content translation
- php filter
- throttle

3rd pty :
see attached png

THanks

pictogram’s picture

After disabling all modules, I found that pathauto seems to conflict ?? I'm using the 6.x-1.x-dev.

Should I issue the conflict in pathauto or is it a drupal 6 problem ???

pictogram

neclimdul’s picture

I still couldn't reproduce this with pathauto installed. But, I ran with the latest checkout from CVS so its possible its been fixed recently.

By conflict, do you mean the problem only occurs when pathauto is installed?

fokkezb’s picture

I get this error every time I want to add a taxonomy term. I also have pathauto installed.

fokkezb’s picture

Project: Drupal core » Pathauto
Version: 6.0-rc4 » 6.x-1.x-dev
Component: forum.module » Code

I also get it when I bulk generate paths... so it's not a Drupal Taxonomy but Pathauto bug. For this, I changed project of this issue.

joglin’s picture

StatusFileSize
new1.21 KB

I have the same problem. There is a bug in php and in Pathauto
Php bug details: http://bugs.php.net/bug.php?id=42177
See attachment for details about pathauto

pictogram’s picture

By conflict, do you mean the problem only occurs when pathauto is installed?

definitely yes !!

pictogram

greggles’s picture

@joglin - interesting research. Do you have any ideas on how to fix this? I haven't looked into it yet myself.

joglin’s picture

taxonomy_token_values() provide itself to fill keys 'cat' and 'cat-raw'. What do these lines mean?

pathauto.module lines 433 - 437

// We only do this for taxonomy because token already provides the [term] value but has problem with [cat] TODO: fix that?
if ($type == 'taxonomy') { 
  $values[$label] = check_plain($category->name);
  $values[$label .'-raw'] = $category->name;
}
mrgoltra’s picture

subscribing.

Not just in the Forums for me. I get this when creating any new term in any taxonomy. Fresh install of RC4

JMowery’s picture

I am also getting this error. Only happens when Pathauto is enabled. Running Drupal 6 final.

account-deletion-needed’s picture

I can confirm this on my side, too. Happens every time I add/change a taxonomy term. Using Drupal 6.0 final.

hgreer’s picture

Also having this problem on a new install of Drupal 6. It happens when Bulk Generating aliases.
Any word on the what the fix is yet?

greggles’s picture

If I had a fix for this I assure you I wouldn't be hiding it ;)

I'm working to stabilize and release a 5.x-2.1. Once I'm done with that I will begin to look into some of these 6.x specific bugs. If someone else can investigate/fix this I would appreciate it.

adityaw’s picture

I have the same problem with pathauto and drupal 6 final when adding taxonomy terms.

JMowery’s picture

I can also confirm this happening with bulk updates.

However, I have more errors now. Here is the output after a bulk update:

* The configuration options have been saved.
* Bulk generation of terms completed, one alias generated.

* warning: array_merge_recursive() [function.array-merge-recursive]: recursion detected in /var/www/html/includes/module.inc on line 473.
* warning: mb_ereg_replace() expects parameter 3 to be string, array given in /var/www/html/sites/all/modules/pathauto/pathauto.inc on line 165.

CosmicVoyager’s picture

subscribed

joglin’s picture

StatusFileSize
new1.24 KB

I solved it

greggles’s picture

Status: Active » Needs review

@joglin - can you explain your patch like why you removed the code you removed? I haven't looked into this yet so I'm not sure I understand that.

joglin’s picture

Status: Needs review » Active

taxonomy_token_values() and pathauto_token_values(), provide to the tokens 'cat' and 'cat-raw'.

In drupal5 module_invoke_all use array_merge() to merge all the values retured from the modules to implement an hook
in this case last value overwrite the previous with the same key.
In drupl6 instead, module_invoke_all() use array_merge_recursive(). The same keys merged generates a subarray. In this case, a bug PHP throw the false warning and stop merging. But the result of call module_invoke_all ("token_values ", ...) by token contains subarray in 'cat' and (if the bug in the PHP does not exist) in 'cat-raw'. After pathauto_clean_token_values() normalize this subarray in an empty string.

sorry for my english

greggles’s picture

Status: Active » Needs review

Thanks very much for the explanation joglin. The patch (code needs review) status is the best for this issue since there is a patch attached and, if it gets reviewed by a few people as working then it can be committed.

Thanks again.

milianw’s picture

I can confirm that this solves this issue. Also it makes it possible for me to once again add terms via free tagging while editing / creating content. Thanks joglin.

I've done some debugging, and here are the results, I can't really see whats the problem, but well, the patch solves it nonetheless:

I've added above and below the lines which were changed by the patch a dprint_r($values) call and here are the results:

unpatched

above code changes:
Array
(
    [termpath] => /sometag
    [termpath-raw] => /sometag
)

below code changes:
Array
(
    [termpath] => /sometag
    [termpath-raw] => /sometag
    [termalias] => 
)

patched code

above code changes:
Array
(
    [catpath] => /huso
    [catpath-raw] => /huso
)

below code changes:
Array
(
    [catpath] => /huso
    [catpath-raw] => /huso
    [catalias] => huso
)

above code changes:
Array
(
    [termpath] => /huso
    [termpath-raw] => /huso
)

below code changes:
Array
(
    [termpath] => /huso
    [termpath-raw] => /huso
    [termalias] => tag/huso
)

So the function gets called twice after applying the patch. The tag gets generated as well to my liking. So once again - thank you joglin!

JMowery’s picture

Sweet, it appears it is working then. Hopefully a few others can confirm so it can be committed.

hansamurai’s picture

I am getting the same errors when trying to apply bulk generation of taxonomy aliases.

# warning: array_merge_recursive() [function.array-merge-recursive]: recursion detected in /home/domain/public_html/includes/module.inc on line 473.
# warning: mb_ereg_replace() expects parameter 3 to be string, array given in /home/domain/public_html/modules/pathauto/pathauto.inc on line 165.

I'm not sure how to patch though so I'll probably wait until it has been committed.

JMowery’s picture

hansamurai, I received this error as well. I am not sure if the patch fixes this, but I am hopeful.

poehnix’s picture

Patch works for me too (adding a taxonomy term)

joglin’s picture

Patch solves all warning array_merge_recursive() relating to taxonomy and empty tokens [cat] and [cat-raw]

greggles’s picture

Status: Needs review » Fixed

Thanks everyone for the patch and testing and especially to joglin and milianw.

I've applied this to HEAD. It seems to fix a few other issues, so that's nice.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

Babalu’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Closed (fixed) » Needs work

(Stripping trailing CRs from patch.)
patching file pathauto.module
Hunk #1 FAILED at 430.

patch not working for me

error is:
warning: mb_eregi_replace() expects parameter 3 to be string, array given in /var/www/web3/html/sites/all/modules/pathauto/pathauto.inc on line 228.

greggles’s picture

Status: Needs work » Closed (fixed)

@Babalu - there are many possible reasons for that error message, this page is only one of them.

See http://www.google.com/search?hl=en&q=+site:drupal.org+mb_eregi_replace()+expects+parameter+3+to+be+string,+array+given+in+pathauto.inc+on+line

Generally speaking these days the reason for that error is an improper hook_token_values implementation in some other module.

brianbrown’s picture

I have this issue also with the exact same error as illustrated in the description.Please reopen.
Thanks!
Brian Brown, Ph.D.

brianbrown’s picture

It turns out that my issue (which was IDENTICAL to this issue) was being caused by the twitter module!
-Brian