[regression] install_get_form does not allow install_settings_form ['driver'] to be null

Created on 20 December 2023, about 1 year ago
Updated 12 January 2024, 11 months ago

Problem/Motivation

โœจ Introduce database driver extensions and autoload database drivers' dependencies Fixed 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

๐Ÿ› Bug report
Status

Fixed

Version

10.2 โœจ

Component
Databaseย  โ†’

Last updated 2 days ago

  • Maintained by
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands @daffie
Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States bnjmnm Ann Arbor, MI

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024