Closed (fixed)
Project:
User Badges
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Apr 2012 at 20:30 UTC
Updated:
12 Jul 2012 at 09:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
nevets commentedThis is because presave is not an appropriate hook work done since the user is not yet defined for new users, the code should be in user_insert() and user_update().
Comment #2
dhlconsult commentedin sites/all/modules/user_badges/user_badges.module on line 315 i deleted
function user_badges_user_presave(&$edit, $account, $category) {
and added
function user_badges_user_update(&$edit, $account, $category) {
this is first thing: now it is run at user registration / update.
part two is the problem with saving the role badges. solution was a patch i found somewhere here on drupal (cant find it now...)
also line 299
deleted if (!key_exists($roles[$rid], $account->badges)) {
added if (!@key_exists($roles[$rid], $account->badges)) {
anyways, now it works. one little caveat though: when updating user (for instance blocking) it does not seem to change. however, i can live with that. at least now it works "good enough 'till a fix is there".
you're welcome ;-)
Comment #3
nancydruThanks for your efforts.
Comment #4
imoreno commentedThis issue still happens with the last dev from 25.6.12.
when a user is logged in he gets this error on the first user page.
While not critical it would be nice if this could be fixed as this error message is not so friendly for a logged-in user..
BR
Itzhak
Comment #5
SebCorbin commentedCan you try the following patch?
Comment #6
imoreno commentedThank you SebCorbin,
with last release from 27.6.12 + patch #5 did the trick for me.
the error is gone.
BR
Itzhak
Comment #7
SebCorbin commentedCommitted!