Hi all,
Just wanted to confirm whether my assessment is right or wrong
In the method User::getRoleID($role_title), the global variable $roles is used. From the
other portions of code in class.user.php, I understand that other role-related methods
like User::getRole() and User::getRoles(), $GLOBALS['localized_roles'] is used.
I feel that User::getRoleID() should also use $GLOBALS['localized_roles'] instead of
$roles that contains only untranslated role titles. I wrote a code as part of my
workflow engine wherein I am comparing the role id of user to that of a Reporter. So I
wrote 'if ($usr_role_id == User::getRoleID(ev_gettext('Reporter')))'. In my
implementation of eventum, 'Reporter' is translated as 'Employee'. So, the method
User::getRoleID(ev_gettext('Reporter'))) just returns a NULL as there is no role title
'Employee' in the $roles array but is there in $GLOBALS['localized_roles'].
Could anyone confirm / explain why User::getRoleID() method is not referring to
$GLOBALS['localized_roles'] - any good reason?
Thanks and rgds,
Watson
| Thread |
|---|
| • Seems to be a bug in User::getRoleID() | M IN BLR SISL Srivathsan | 24 Sep |