Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300003

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

$
0
0

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


Viewing all articles
Browse latest Browse all 300003

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>