Module causes a pathauto error message to appear in certain circumstances
| Project: | Known User Role |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | greg.harvey |
| Status: | closed |
Jump to:
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. =)
| Attachment | Size |
|---|---|
| known_user_role_v1.patch | 3.93 KB |

#1
Thanks for detail and patch. Will review ASAP. =)
#2
Committed and in latest release! Thanks! =)
#3
Automatically closed -- issue fixed for 2 weeks with no activity.