Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have installed Pressflow, with that my error reporting is raised and I get:
* Warning: mb_eregi_replace() expects parameter 3 to be string, array given in pathauto_cleanstring() (line 136 of /Applications/MAMP/htdocs/sitename/sites/all/modules/pathauto/pathauto.inc).
* Warning: mb_strtolower() expects parameter 1 to be string, array given in drupal_strtolower() (line 441 of /Applications/MAMP/htdocs/sitename/includes/unicode.inc).
There is a lot to do about this error, as far as I can tell it's a wrong implementation of a token.
I updated Token but still getting the same error.
When I comment out both token functions in i18nmenu_node.module the error go away, but I don't know as to how well the module works now.
Comment | File | Size | Author |
---|---|---|---|
#12 | i18nstrings-token_error--1025742--12.patch | 698 bytes | jessehs |
#8 | i18nstrings_cache-translation_return-value.png | 80.27 KB | jessehs |
#8 | i18nmenu_node-token_error--1025742--8.patch | 1.42 KB | jessehs |
Comments
Comment #1
plachProbably you need to update Pathauto as well. See #926130: Add support for Pathauto segment cleaning mode.
Comment #2
botrisI'm using Token 1.15 and Pathauto 1.5 both latest stable.
The patch in #926130 is pre Menu translation beta2 and is does not need to be applied.
So I'm up to date with all modules.
Still getting the errors.
Comment #3
plach@Boriss:
Ok, but I can't see them. Would you please post the steps to reproduce this starting from a clean D6 installation, Menu Translation (node) 1.0-beta2, Token 1.15 and Pathauto 1.5?
Comment #4
plachClosing the issue. Reopen if needed.
Comment #5
tcibah CreditAttribution: tcibah commentedWe are getting those error messages, given below.
Our Drupal isntall is updated regularly; here is the current startus:
Pressflow/D6.20
No Internationalization, no Menu Translation (node)
Token 1.15
Pathauto 1.5
The error:
• Warning: mb_eregi_replace() expects parameter 3 to be string, array given in pathauto_cleanstring() (line 136 of /home/user1/public_html/drupal/sites/all/modules/pathauto/pathauto.inc).
• Warning: mb_strtolower() expects parameter 1 to be string, array given in drupal_strtolower() (line 441 of /home/user1/public_html/drupal/includes/unicode.inc).
• Warning: mb_eregi_replace() expects parameter 3 to be string, array given in pathauto_cleanstring() (line 136 of /home/user1/public_html/drupal/sites/all/modules/pathauto/pathauto.inc).
• Warning: mb_strtolower() expects parameter 1 to be string, array given in drupal_strtolower() (line 441 of /home/user1/public_html/drupal/includes/unicode.inc
Appreciate your efforts.
Comment #6
plachWell, this simply means this is not a MTN issue: probably there is another module enabled which is not integrating with Token/Pathauto correctly.
Comment #7
jessehsI get the same errors. Commenting out the hook_token_values and hook_token_list functions removes the warnings.
I'm running:
Pressflow 6.22
Token 1.16
Pathauto 1.5
and about a hundred more modules including custom code. My custom modules do not implement any token hooks.
I'll work on pinpointing this further.
Comment #8
jessehsThe error message occurs when a new node is created, but not placed in a menu. Also, when a node is edited that is not in any menu. (The mlid is 0.)
The function i18nstrings('menu:item:0:title', '', 'en') is called to get the translation of the menu item title.
This calls i18nstrings_translate_string() that then calls i18n_get_string(), which finally calls i18nstrings_cache().
This is where the problem occurs, as far as I can tell. It seems this function (i18nstrings_cache) finds a translation in the static $strings variable, then returns a huge array of arrays (screenshot attached). This is where the error comes from.
It seems like perhaps checking for the case of whether the menu item is mlid 0 or not will fix the problem. I've attached a patch tested against 6.x-1.1.
Comment #9
plachComment #10
plachComment #11
jessehsIf calling the function i18nstrings('menu:item:0:title', '', 'en') is valid, the solution lies in a patch to the Internationalization module.
If, on the other hand, no module should call this function, the problem (in the case of this thread) lies with the i18nmenu_node module.
In either case, my thought is that there ought to be a check whether or not the menu link id is "0" before trying to find a translation for a menu link.
Comment #12
jessehsHere's a patch against the i18nstrings module that adds a check in the i18nstrings_translate_string() function to see if the $context returned from i18nstrings_context() is a menu link with the objectid of 0. If so, it returns an empty string. Even though a module probably shouldn't be trying to find a string translation for an impossible object...
(Patch can be applied with -p1 option.)
Comment #13
joseph.olstad