Steps to reproduce:
1. Install Drupal via the user interface.
2. Enter "My Site" for the site name on the installer's configuration page.
3. When you go to the site, you'll see that the site is actually named "Drupal" instead.
The problem isn't fixed until you clear some caches. (For what it's worth, simply visiting admin/config seems to do it, so whatever cache is cleared on that page visit is the culprit.)
A very similar bug existed in the early days of Drupal 7, and the code which fixed it is known to have regressed in Drupal 8 (see #1394648: The installer's cache backend no longer overrides all cache-clearing methods, which can lead to fatal errors). So I would have thought the patch there would have fixed this, but it doesn't seem to. This may actually be a different bug.
I'm marking this major since it's very noticeable and user facing and one of the main form fields people tend to fill out in the installer.
Comment | File | Size | Author |
---|---|---|---|
#9 | before.jpg | 7.32 KB | xjm |
#9 | after.jpg | 18.02 KB | xjm |
#6 | drupal8.database-class.6.patch | 2.82 KB | sun |
Comments
Comment #1
tim.plunkettIt seems that the variable cache isn't being cleared at all.
Another instance of this is in drupal_install_profile_distribution_name() which is evident on /admin/modules after installing with minimal.
The name of the install profile isn't retrieved properly from the variables, so it tries to use standard, causing
Notice: Undefined index: distribution_name in drupal_install_profile_distribution_name() (line 111 of /Users/tim/www/d8/core/includes/install.inc).
Comment #2
tim.plunkettThis is fixed by the partially finished patch in #973436: Overzealous locking in variable_initialize(), so marking as a duplicate.
Comment #3
David_Rothstein CreditAttribution: David_Rothstein commentedInteresting find! But that patch is a new feature, so I'm curious what actually caused this regression in the first place. I wonder if there's something more fundamental going on here.
Comment #4
sunI agree, #973436: Overzealous locking in variable_initialize() is a new feature and doesn't look like it's going to be ready anytime soon.
@beejeebus noted some variable cache clearing bugs after Drupal installation in IRC some hours ago, which sounded closely related to the symptoms being outlined here.
In terms of potential causes, #636454: Cache tag support landed recently.
Comment #5
David_Rothstein CreditAttribution: David_Rothstein commentedI think I figured it out. The bug is here (and in several other places in InstallBackend.php also):
That class_exists() is checking a class that doesn't exist anymore; the code needs to check for "Drupal\Core\Database\Database" instead. And even adding a "use" statement at the top of the file won't help here, because it's a string so the fully-qualified name needs to be passed.
I'm guessing for the installer bug, if we roll that change into the patch at #1394648: The installer's cache backend no longer overrides all cache-clearing methods, which can lead to fatal errors it would probably fix things (and there are already tests over there too).
However, this isn't the only place in the codebase that's using class_exists() in this way so we may have other similar bugs also.
Comment #6
sunAwesome finding!
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedthis patch fixes the issues i was seeing - nice find!
sad panda though - i guess this means we broke it months ago.
Comment #8
sunAlrighty, let's get this in. Not testable, because we're still not able to test the installer yet.
Comment #9
xjmI tested the patch locally and confirmed that it resolves the issue.
Before applying the patch, immediately after installing a fresh copy of D8 and setting a site name other than "Drupal":
After the patch, new fresh install, immediately after installing:
Comment #10
xjmOopsie. Agreed it's RTBC.
Comment #11
David_Rothstein CreditAttribution: David_Rothstein commentedLooks good, but it actually is testable (indirectly, at least).
I just rolled these changes into the patch at #1394648: The installer's cache backend no longer overrides all cache-clearing methods, which can lead to fatal errors and the tests there should reveal this bug. That issue touches more problems than just this one so it can be separate, but it would be great to get those tests in because it's unfortunate that this stuff keeps breaking.
Comment #12
sun@David_Rothstein: You're not actually testing the installer over there, so I fail to see how this is actually testable. :) I'm currently working on a couple of patches that happen to try to invoke the Drupal installer via API or UI, and apparently, each one of those is blowing up (killing) the entire Apache web server process. Given the experience of those patches, we're still far away from functional tests for the installer that assert the actual behavior.
Comment #13
David_Rothstein CreditAttribution: David_Rothstein commentedWell, it's not a functional test, but it directly tests the cache behavior that causes this bug, and therefore exposes the bug.
I'm going to go bump the priority of that issue to "major". (Another option would be to split up the tests from that issue and move some of them over here before committing this patch, but I'm not sure it's worth the effort.)
Comment #14
catchThis looks good to me, and the other issue adds tests, shame it was broken for so long, although I'm slightly glad that cache tags wasn't responsible :p
Committed/pushed to 8.x.