Skip to content

Commit

Permalink
Issue #86: Fixed errors when loading generated data
Browse files Browse the repository at this point in the history
  • Loading branch information
tabroughton authored and herbdool committed Aug 14, 2019
1 parent 808d24c commit 1523d50
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions drush/civicrm.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -384,29 +384,32 @@ function _civicrm_install_db($dbuser, $dbpass, $dbhost, $dbname,
drush_log(dt("Loading CiviCRM database structure .."));
civicrm_source($dsn, $sqlPath . '/civicrm.mysql');
drush_log(dt("Loading CiviCRM database with required data .."));
// testing the translated sql files availability
$data_file = $sqlPath . '/civicrm_data.mysql';
$acl_file = $sqlPath . '/civicrm_acl.mysql';
if ($lang != '') {
if (file_exists($sqlPath . '/civicrm_data.' . $lang . '.mysql')
and file_exists($sqlPath . '/civicrm_acl.' . $lang . '.mysql')
and $lang != ''
) {
$data_file = $sqlPath . '/civicrm_data.' . $lang . '.mysql';
$acl_file = $sqlPath . '/civicrm_acl.' . $lang . '.mysql';
}
else {
drush_log(dt("No sql files could be retrieved for \"" . $lang .
"\", using default language."
), 'warning');
}
}
civicrm_source($dsn, $data_file);
civicrm_source($dsn, $acl_file);

if ($loadGeneratedData) {
drush_log(dt("Loading in generated data .."));
civicrm_source($dsn, $sqlPath . DIRECTORY_SEPARATOR . 'civicrm_generated.mysql', TRUE);
}
else {
// testing the translated sql files availability
$data_file = $sqlPath . '/civicrm_data.mysql';
$acl_file = $sqlPath . '/civicrm_acl.mysql';
if ($lang != '') {
if (file_exists($sqlPath . '/civicrm_data.' . $lang . '.mysql')
and file_exists($sqlPath . '/civicrm_acl.' . $lang . '.mysql')
and $lang != ''
) {
$data_file = $sqlPath . '/civicrm_data.' . $lang . '.mysql';
$acl_file = $sqlPath . '/civicrm_acl.' . $lang . '.mysql';
}
else {
drush_log(dt("No sql files could be retrieved for \"" . $lang .
"\", using default language."
), 'warning');
}
}
civicrm_source($dsn, $data_file);
civicrm_source($dsn, $acl_file);
}
drush_log(dt("CiviCRM database loaded successfully."), 'ok');
}

Expand Down

0 comments on commit 1523d50

Please sign in to comment.