This behaviour seems to have been lost with the DBTNG patch.

No default selection

On the database screen, there is no option selected by default. Since 99.9999% of sites use MySQL, we ought to make it the default.

CommentFileSizeAuthor
#7 panda.patch1.97 KBAnonymous (not verified)
#1 299330-sad-panda.patch2.29 KBDamien Tournoud
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Title: Select MySQL as default database driver » Select MySQL as default database driver, and fix a E_ALL warning during install
Status: Active » Needs review
FileSize
2.29 KB

No panda shall remain sad.

webchick’s picture

Ha, thanks!

Works fine. I asked why this is longer than a one-line change, and Damien pointed out that not all installations may have MySQL, so we should only default to it if it exists. Touché.

current(array_keys($drivers)) would be a bit more clear as just key($drivers).

+ $database = isset($databases['default']['default']) ? $databases['default']['default'] : array(); is weird. $database['default']['default']? I realize this isn't specific to this patch, but why a nested array like that? Can we add some documentation to that line?

webchick’s picture

Status: Needs review » Needs work
Damien Tournoud’s picture

current(array_keys($drivers)) would be a bit more clear as just key($drivers).

Not really. key($drivers) is the key of the current position in $drivers. current(array_keys($drivers)) is the first key of $drivers. There is no real guarantee that both will be equal.

+ $database = isset($databases['default']['default']) ? $databases['default']['default'] : array(); is weird. $database['default']['default']? I realize this isn't specific to this patch, but why a nested array like that? Can we add some documentation to that line?

The syntax of the $databases array is described in settings.php:

* For each database, you may optionally specify multiple "target" databases.
* A target database allows Drupal to try to send certain queries to a
* different database if it can but fall back to the default connection if not.
* That is useful for master/slave replication, as Drupal may try to connect
* to a slave server when appropriate and if one is not available will simply
* fall back to the single master server.
*
* The general format for the $databases array is as follows:
*
* $databases['default']['default'] = $info_array;
* $databases['default']['slave'][] = $info_array;
* $databases['default']['slave'][] = $info_array;

webchick’s picture

Status: Needs work » Reviewed & tested by the community

Fair enough then. :)

Dries’s picture

Status: Reviewed & tested by the community » Needs work

Unfortunately, this panda will have to wait for a re-roll. Patch no longer applies. The end() trick might be better than the current trick.

Anonymous’s picture

FileSize
1.97 KB

i created a duplicate issue for this.

i've attached an updated patch, but it still doesn't quite match the doco. do we want to handle the case i described in the issue above (which this patch doesn't manage), or do we need to update the docs?

Damien Tournoud’s picture

Status: Needs work » Reviewed & tested by the community

The patch in #7 is good to go, thanks justin.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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