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.
ok, there are actually two problems here, in function update_fix_access_table in update.php:
- this check always fails, b/c $conf is empty at that point:
if (variable_get('update_access_fixed', FALSE)) { return; }
- variable_set bombs, b/c the call to cache_clear_all in that function is no longer available--it was moved to cache.inc.
it appears that the first bug went unnoticed for awhile, b/c even though the initial check failed, the subsequent code was running w/o creating any errors.
Comment | File | Size | Author |
---|---|---|---|
#2 | update_fix_access_bootstrap.patch | 861 bytes | dww |
Comments
Comment #1
hunmonk CreditAttribution: hunmonk commentedwhoops. this is only on HEAD, i believe...
Comment #2
dwwconfirmed: only in HEAD.
the symptom is a totally blank page -- no output, when run on MySQL >= 4.1. unfortunately, i ran into this same bug and debugged it on my own. then i searched the queue and found this issue. ;) whoops.
anyway, indeed, the bug is that update_fix_access_table() is trying to use variable_get() and variable_set(). unfortunately, it's being called before drupal_bootstrap(), so those functions aren't really available. worse yet, when variable_set() attempts to call cache_clear_all(), the script (silently) crashes, since cache.inc hasn't been included yet.
i considered trying to just include cache.inc first, but that still doesn't solve the problem of the variables we're looking at and setting not really being there. so, instead, i moved update_fix_access_table() to *after* the call to drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL).
to confirm that this is safe, i just did the following:
given that, the update started producing output again. ;) moreover, after the update ran, i had:
update_access_fixed b:1;
in my {variable} table. and, best of all, a mysqldump showed me that the {access} table was now utf8.so, unless i'm missing something truly mysterious about drupal_bootstrap(), my patched version of update.php seems to do all the right things.
Comment #3
chx CreditAttribution: chx commentedExcellent work. Only question was: does the relocated function something which would stop bootstrapping? No, it only converts the access table to UTF-8, so the only possible problem could be that in some very, very unfortunate and arcane case the admin finds himself denied. This is so improbable that RTBC.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks a bunch!
Comment #5
(not verified) CreditAttribution: commented