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

$databases definition is different in install_settings_form_submit() and drupal_rewrite_settings()

$
0
0

Symptoms:

latest code from 8.x fails to install, throwing fatal PHP error Cannot use object of type stdClass as array in .../core/includes/install.inc on line 257

Steps to reproduce:

  1. Get the latest 8.x source code
  2. Copy sites/default/default.settings.php to sites/default/settings.php
  3. Launch installer
  4. Choose English. Press Save and Continue
  5. Choose Standard profile. Press Save and Continue
  6. Proceed to database connection details screen. Press Save and Continue
  7. Bingo. Error 500

Analysis

Error comes from line 257 in includes/install.inc:

<?php
if (isset($current[$index])) {
?>

$current is a part of $settings array coming to drupal_rewrite_settings() from install_settings_form_submit():
(install.core.inc, lines 1109-1112)
<?php
  $settings
['databases'] = (object) array(
   
'value'    => array('default'=> array('default'=> $form_state['storage']['database'])),
   
'required'=> TRUE,
  );
?>

$current (part of $settings parameter) is an object, while drupal_rewrite_settings() expects array

I set this to critical, because this leaves installation in unusable state.

Update

Clean install without any settings.php goes just fine
Dropping existing database, and trying to re-install with automatically generated settings.php fails.


Viewing all articles
Browse latest Browse all 291123

Trending Articles



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