Installing CiviCRM in another language, with civicrm-setup
I have perhaps a bit of a less-common setup, with Aegir, and running into the following situation when installing CiviCRM on Drupal8 with the 'new' civicrm-setup installer:
At first, the installer failed because of:
Error: Call to a member function getPath() on null in CRM_Core_I18n::getResourceDir()
(line 301 of [...]/vendor/civicrm/civicrm-core/CRM/Core/I18n.php
So I patched with the following in civicrm-setup/plugins/installDatabase/InstallSchema.civi-setup.php
:
elseif ($seedLanguage) {
global $tsLocale;
$tsLocale = $seedLanguage;
// Added this:
require_once $model->settingsPath;
\Civi\Core\Container::boot(FALSE);
but now I'm getting:
Exception: No domain in DB
since Civi/Core/Paths.php
initializes CRM_Core_Config::singleton(), which checks for a domain.
trace:
civicrm-core/CRM/Core/Config.php line 115
civicrm-core/Civi/Core/Paths.php line 36
civicrm-core/Civi/Core/Paths.php line 145
civicrm-core/Civi/Core/Paths.php line 189
civicrm-core/Civi/Core/Paths.php line 84
civicrm-core/Civi/Core/Paths.php line 145
civicrm-core/Civi/Core/Paths.php line 189
civicrm-core/CRM/Core/I18n.php line 301
i.e. it ends up running:
->register('civicrm.root', function () {
return \CRM_Core_Config::singleton()->userSystem->getCiviSourceStorage();
})
which brings me to a bit of a catch-22, because civicrm_domain
gets populated by sql/civicrm_data.fr_CA.mysql
.
I feel like this is a regression caused by the new-ish [civicrm.l10n]
variable.
If I patch CRM/Core/I18n.php
to return a hardcoded l10n resourceDir, the installer runs fine.