Problem/Motivation
This error occurs when the user has more then one role:
Notice: Undefined offset: 10 na user_view_mode_entity_view_mode_alter() (linha 82 de /var/www/clients/client3/web14/web/repos/ualg/web/modules/contrib/user_view_mode/user_view_mode.module)
Steps to reproduce
Have a site when lot of roles.
Assign 2 distinct role with the same view mode.
When he has 2 roles, the view mode will reset to full, and the above Notice comes up.
Proposed resolution
Change the line 79 of file user_view_mode.module to this:
$highest_id_weight = $i;
and that's it.
The bug is to load the role not using the id which scores the most, but the id of the weight, that is wrong.
Remaining tasks
To build a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3248969-2.patch | 585 bytes | chucksimply |
Comments
Comment #2
chucksimply commentedAdding a patch for the above
Comment #3
jrochate commentedComment #5
yahyaalhamadThanks for the patch, applied.
Comment #6
yahyaalhamad