Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.We currently set it like so in hosting.module:
define('HOSTING_DEFAULT_DB_SERVER', variable_get('hosting_default_db_server', 2));
But in recent Aegir installs, server_localhost is actually node/4.
Furthermore, while this can be set by changing the variable manually, it should really be exposed as a radio button on the settings page, IMO.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | hosting-default_db_server-2259235-3.patch | 1.36 KB | ergonlogic |











Comments
Comment #1
lavamind CreditAttribution: lavamind commentedThis can especially be a problem when running migrate and clone tasks. If these tasks are failing for no obvious reason, and the following error appears in the task log, then
hosting_default_db_servermight contain an invalid value.Drush was not able to start (bootstrap) the Drupal databaseComment #2
ergonlogicWe already set the hosting_default_db_server with the appropriate NID in hostmaster.install. So this is only for older installs, where this might not be set, or if the variable gets deleted. I think we should update this default value to 4.
In terms of the feature request, i.e. being able to configure this from the front-end, it should be pretty simple. Just build a radio form element from hosting_get_servers('db'), and set the variable accordingly.
Comment #3
ergonlogicThis patch does both the suggestions above.
Comment #4
helmo CreditAttribution: helmo commentedThe patch from #3 was committed in #2280081: Allow setting default database server