Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The code
if ($recaptcha_ajax_api) {
// By default CAPTCHA turns off page caching on
// any page where a CAPTCHA challenge appears.
// If recaptcha is using AJAX API, set caching
// back to it's old state as stored in DB.
global $conf;
$cache = variable_get('cache', FALSE);
$conf['cache'] = $cache;
}
won't reset $conf['cache'] to what is inside the DB as variable_get() uses the global $conf as well. So this will stay FALSE as set by the captcha module even if ajax is used as you write the same value to the variable as it was before.
function variable_get($name, $default = NULL) {
global $conf;
return isset($conf[$name]) ? $conf[$name] : $default;
}
Currently I don't have any idea how we can easily get the original value back except for a custom query. I will so a patch asap if I get a good idea to what to do here.
Comment | File | Size | Author |
---|---|---|---|
#6 | recaptcha-1759334.patch | 1.37 KB | Liam Morland |
#5 | recaptcha-1759334_v02.patch | 594 bytes | Kars-T |
#1 | recaptcha-1759334.patch | 597 bytes | Kars-T |
Comments
Comment #1
Kars-T CreditAttribution: Kars-T commentedThe only way I found was using a direct query. I kept it as small as possible. But this makes sure we get the setting from the database.
Comment #2
Liam MorlandWhy
WHERE name LIKE 'cache'
instead ofWHERE name = 'cache'
?Comment #3
Kars-T CreditAttribution: Kars-T commentedWe are looking for a string and so I am "used" to use LIKE.
http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html
As we use a fixed value here that does not demand LIKE we can use = as well and it might be faster by some ms. So choose what you LIKE ;)
Should I reroll the patch to = than?
Comment #4
Liam MorlandPlease do. Thanks.
Comment #5
Kars-T CreditAttribution: Kars-T commentedNew patch version with "="
Comment #6
Liam MorlandFixed in 94ede9404f8e60a561d8c990e64d9b054b47276f. Patch as-committed attached.
Comment #10
hass CreditAttribution: hass commented