I set a user as blocked and got this error message:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASE WHEN b.fixedweight = 1 THEN b.weight ELSE COALESCE(u.userweight,b.weight) E' at line 3: SELECT DISTINCT b.bid, u.uid, b.weight, b.name, b.image, b.href, b.unhideable, b.fixedweight, b.doesnotcounttolimit, u.userweight, b.tid, r.rid CASE WHEN b.fixedweight = 1 THEN b.weight ELSE COALESCE(u.userweight,b.weight) END coalescedweight FROM {user_badges_badges} b INNER JOIN {user_badges_user} u ON b.bid = u.bid LEFT JOIN {user_badges_roles} r ON b.bid = r.bid WHERE u.uid = :uid AND r.rid = :rid ORDER BY coalescedweight, b.name; Array ( [:uid] => 2273 [:rid] => 0 ) in user_badges_get_badges() (Zeile 962 von /is/htdocs/wp1183236_ZRSG84RKG4/www/beta/sites/all/modules/user_badges/user_badges.module).

CommentFileSizeAuthor
#7 CapturFiles.jpg51.76 KBWolfgang62
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

shabana.navas’s picture

I cannot recreate this error on my end, not sure why you are getting this. Could you provide more information.

Wolfgang62’s picture

What kind of information do you need?

shabana.navas’s picture

Is this on a fresh install? If not, was this working before? Have you made any changes to your db? Have you tried reinstalling the user badges module?

Wolfgang62’s picture

It is not a fresh install.
It was working before.
No changes to the db.
A complete deinstallation and reinstallation? No. I will try that.

Wolfgang62’s picture

I did a clean install and the error message is still there.
I get this message when I click on the blocked user.

Wolfgang62’s picture

OK, anyway which user I want to block I get this error message.
What info do you need else?

Edit: I even can not erase the user.
As soon as I deactivate the module everything works fine.

Wolfgang62’s picture

FileSize
51.76 KB

Further research: I only get this error message if "Only show blocked user badge" is set.

And I never can see the badge image on the roles site (see attachement).

shabana.navas’s picture

Status: Active » Fixed

Thanks for trouble shooting this. Finally, found the error. There was a syntax error in the db_query. I have fixed it and committed it to the 7.x-3.x-dev version. Please download the latest version.

Status: Fixed » Closed (fixed)

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