Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This line here:
else {
$query_ttl .= " WHERE points >= :balance";
$args_ttl[':balance'] = $setting['number'];
}
Given there's already a WHERE clause fom WHERE by tid - this can double up on WHERES causing SQL errors.
Comment | File | Size | Author |
---|---|---|---|
#1 | userpoints_evaporate-2001226.patch | 2.61 KB | cafuego |
Comments
Comment #1
cafuego CreditAttribution: cafuego commentedLooks like my logic in that if() block was not actually right at all.
I've redone one of the queries in that section as a db_update() query instead, which will definitely avoid double WHERE errors. However, I don't have an install to test this on over here, so I'll throw a patch on this issue for you to test. Could you please give the patch a try and see if the query still properly lowers the total points for a given points tid?
Comment #2
Bastlynn CreditAttribution: Bastlynn commentedOh wow! Fast response! :) Sure, absolutely - I'll test this out and see how it handles :) Apologies for the somewhat terse initial issue, i usually try to set up patches but it was that-kinda-day today. :)
Comment #3
cafuego CreditAttribution: cafuego commentedTerse? Succinct! :-) I had a spare moment at DrupalCon, so I thought I'd have a poke at a patch :-)
Comment #4
cafuego CreditAttribution: cafuego commentedTested and changed the '+' into a '-', so the points happily evaporate rather than magically appear ;-)