Closed (duplicate)
Project:
Drupal core
Version:
8.3.x-dev
Component:
install system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Oct 2015 at 01:38 UTC
Updated:
28 Mar 2017 at 14:27 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
cweagansPatch attached does the following:
1) Centralize detection of whether or not Drupal is installed into drupal_is_installed()
2) Deprecates install_verify_database_ready(), since it's largely duplicating what's in drupal_is_installed()
3) Call drupal_is_installed() from install_verify_database_ready()
4) Use drupal_is_installed() in the installer to detect whether or not Drupal is installed
Comment #3
cweagansAdded one more place where drupal_is_installed() should be used.
Comment #4
cweagansI'm going to do a bit more on this tomorrow..er..later today. Stand by.
Comment #5
cweaganschx asked me to convert this to a service, rather than hardcoding a new query into every page load. Basically an entirely new patch at this point.
Comment #11
kingdutchUnassigning as this has been dormant for about a year. The issue is still alive and kicking.
The latest patch (using a service) container still needs some work.
The first problem I encountered (running a set-up with settings.php preconfigured) was that it could not find the `install_check` service. This is because the installer doesn't load the entire container from the services.yml file but uses a stripped down version in `install_begin_request` of `install.core.inc`. Adding the following snipped within the guard of `if ($install_state['settings_verified']) {` before the call to `drupal_is_installed()` fixed that first issue.
This snippet uses the a custom definition because I couldn't find a shorthand to add a factory to the container. I'm unsure why this classes uses a factory in the first place. It feels like we only ever need one instance of this service but I'm trying to keep changes minimal as my experience with Drupal 8 is limited.
The following problem we have is that the database service isn't registered. I'm not entirely sure how to fix that. The if statement in `install_begin_request` ensures the database is ready so it would be possible to register the needed service to the container. But this feels like the install method is growing quickly for a relatively simple check so I'm not entirely sure if that's the correct path forward.
Comment #12
lennard westerveldHi @Kingdutch,
Seems it has been fixed for me in 8.3.x did you also test it with the new release candidate?
Kind regards,
Lennard
Comment #13
kingdutchHey @Lennard,
Yes it seems to have been fixed in 3.0-rc2 : )
Removed another patch to make it work. A non installed site now redirects from index to install. Select a language and the installer starts. That's great!
Looks like the the first patch was partially implemented (the drupal_is_installed function can't be found but the check in the installer is present).
Marking this RTBC because I'm not sure if this still needs some kind of Change Record or can just be marked as fixed. I'll leave that to a maintainer :)
Now off to tackle the next error I encounter (unrelated to this issue).
Comment #14
alexpottThis was fixed by #728702: Visiting index.php should redirect to install.php if settings.php already has database credentials but database is empty. which landed in 8.3.x - and has a CR https://www.drupal.org/node/2797353
If I'm wrong - please comment and I'll re-open the issue. I'm not sure a specific CR is necessary - this just works now - at long last.