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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Status: Active » Postponed (maintainer needs more info)

Probably you need to update Pathauto as well. See #926130: Add support for Pathauto segment cleaning mode.

botris’s picture

I'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.

plach’s picture

@Boriss:

Still getting the errors.

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?

plach’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing the issue. Reopen if needed.

tcibah’s picture

We 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.

plach’s picture

No Internationalization, no Menu Translation (node)

Well, this simply means this is not a MTN issue: probably there is another module enabled which is not integrating with Token/Pathauto correctly.

jessehs’s picture

Status: Closed (cannot reproduce) » Active

I 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.

jessehs’s picture

The 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.

plach’s picture

Project: Menu translation (Node) » Internationalization
Component: Code » Strings
plach’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
jessehs’s picture

Status: Needs review » Active

If 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.

jessehs’s picture

Status: Active » Needs review
FileSize
698 bytes

Here'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.)

joseph.olstad’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)