Problem/Motivation

#3256642: Introduce database driver extensions and autoload database drivers' dependencies was added in 10.2, which can break Functional test setup in some enviroments.

The additions included the following in install.core.inc in install_get_form()

if (!empty($install_state['forms'][$install_form_id])) {
      $values = $install_state['forms'][$install_form_id];
      // 👇 HEY! this will crash some Functional Test setups, because  \Drupal\Core\Test\FunctionalTestSetupTrait::installParameters 
      // unsets that property if only one database type is available, but the below assumes it is always set.
      if ($install_form_id === 'install_settings_form' && !str_contains($values['driver'], "\\")) {
        @trigger_error("Passing a database driver name '{$values['driver']}' to " . __FUNCTION__ . '() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Pass a database driver namespace instead. See https://www.drupal.org/node/3258175', E_USER_DEPRECATED);
        $driverExtension = Database::getDriverList()->getFromDriverName($values['driver']);
        $tmp = [];
        $tmp['driver'] = $driverExtension->getName();
        $tmp[$driverExtension->getName()] = $values[$values['driver']];
        $values = $tmp;
      }
      $form_state->setValues($values);
    }

Steps to reproduce

Proposed resolution

Toss an isset() in the statement that currently assumes it is set

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3410093

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bnjmnm created an issue. See original summary.

bnjmnm’s picture

Status: Active » Needs review
mondrake’s picture

Status: Needs review » Reviewed & tested by the community

I was going to suggest adding a test, then realized this code is BC to be removed for 11, so not sure it’s worth it. RTBC, thanks

quietone’s picture

Title: [REGRESSION] install_get_form does not allow install_settings_form ['driver'] to be null » [regression] install_get_form does not allow install_settings_form ['driver'] to be null

Changing title per Special titles.

alexpott’s picture

Version: 11.x-dev » 10.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed ec721fbabb to 11.x and 0d0bcc3bb0 to 10.2.x. Thanks!

  • alexpott committed 0d0bcc3b on 10.2.x
    Issue #3410093 by bnjmnm: [regression] install_get_form does not allow...

  • alexpott committed ec721fba on 11.x
    Issue #3410093 by bnjmnm: [regression] install_get_form does not allow...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.