If a non 'superuser' user saves a node the following message displays
warning: mb_eregi_replace() expects parameter 3 to be string, array given in C:\Program Files\wamp\www\connect\trunk\www\sites\all\modules\contribs\pathauto\pathauto.inc on line 185.

I tracked down the culprit to this line of code. $form['uid']['#value'] = explode('|',$_COOKIE['known_user_role_details'],1);

Assume
$_COOKIE['known_user_role_details'] = "164|randomuser";

If we use $form['uid']['#value'] = explode('|',$_COOKIE['known_user_role_details'],1); to extract the uid.
The value returned to $form['uid']['#value'] will not be 164.
It will be $form['uid']['#value'] =Array([0] => 164|wai).

The solution is a 2 liner.
+ $fragments = explode('|',$_COOKIE['known_user_role_details']);
+ //get uid
+ $form['uid']['#value'] = $fragments[0];

Let me know if you have any questions. =)

CommentFileSizeAuthor
known_user_role_v1.patch3.93 KBwkmit

Comments

greg.harvey’s picture

Assigned: Unassigned » greg.harvey

Thanks for detail and patch. Will review ASAP. =)

greg.harvey’s picture

Status: Needs review » Fixed

Committed and in latest release! Thanks! =)

Status: Fixed » Closed (fixed)

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