Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Installation Profile Not Approparely Set #17

Closed
populist opened this issue Sep 23, 2014 · 5 comments
Closed

Installation Profile Not Approparely Set #17

populist opened this issue Sep 23, 2014 · 5 comments

Comments

@populist
Copy link

The installation profile is not properly set resulting in a couple notices on admin pages and this reporting in the system status:

Installation profile (-)

@populist
Copy link
Author

populist commented Oct 1, 2014

This line was added to the system.install file for the time being to deal with this:
$profile = (drupal_get_profile()) ? drupal_get_profile() : 'standard';

greg-1-anderson added a commit to greg-1-anderson/drops-8 that referenced this issue Mar 26, 2015
@greg-1-anderson
Copy link
Member

In Drupal-8.0-beta9, I had to expand the scope of this issue to also default to the 'standard' installation profile later in the installation process. Without this change, Settings::get('install_profile') returns an empty value, and you run afoul of this code in ConfigInstaller:

    // Install profiles can not have config clashes. Configuration that
    // has the same name as a module's configuration will be used instead.
    if ($name != $this->drupalGetProfile()) {
      // Throw an exception if the module being installed contains configuration
      // that already exists. Additionally, can not continue installing more
      // modules because those may depend on the current module being installed.
      $existing_configuration = $this->findPreExistingConfiguration($storage);
      if (!empty($existing_configuration)) {
        throw PreExistingConfigException::create($name, $existing_configuration);
      }
    }

Here, and elsewhere in the installation process, Drupal is using $name != $this->drupalGetProfile() to mean "if $name is not an installation profile...". This test is okay during installation, because the only value of $name that might be an installation profile is the installation profile the user selected during installation. If Settings::get('install_profile') is not returning the correct value, then the wrong code will run -- in the case of the snippet above, the symptom is a false-positive on the pre-existing configuration test.

Returning 'standard' as the default value for drupalGetProfile() is therefore insufficient, because the test to see if $name is an installation profile is no longer doing a correct comparison. For example, if the user selects the "minimal" installation profile, then the installation will fail.

@populist
Copy link
Author

The general problem here is that as part of the installation process the install_profile value is written to the settings.php. However, since we skip the database installation step (where the DB stuff is written to settings.php) I bet the install profile value also gets skipped, hence our problems.

Probably going to define that in settings.php explicitly and look at https://www.drupal.org/node/2451363 for further information here.

@populist
Copy link
Author

populist commented Apr 2, 2015

This will be soon be defined explicitly in settings.php to prevent this error, but will require a more thorough review.

@populist
Copy link
Author

populist commented May 6, 2015

As of Drupal 8 Beta 10 the installer is now appropriately setting the value. This however won't work in Git mode (#36), but it will work correctly in SFTP mode and there is another issue for Git mode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants