Skip to content
Snippets Groups Projects
Commit 4636d4fd authored by lobo's avatar lobo
Browse files

CRM-12416 also fix warnings when running regen

----------------------------------------
* CRM-12416: Database problems when installing Danish language as basic data set
  http://issues.civicrm.org/jira/browse/CRM-12416
parent fe7e8013
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,7 @@ abstract class CRM_Utils_Hook {
) {
$this->commonBuildModuleList($fnPrefix);
return $this->runHooks($this->commonCiviModules, $fnSuffix,
$numParams, $arg1, $arg2, $arg3, $arg4, $arg5
);
......@@ -131,43 +131,45 @@ abstract class CRM_Utils_Hook {
) {
$result = $fResult = array();
foreach ($civiModules as $module) {
$fnName = "{$module}_{$fnSuffix}";
if (function_exists($fnName)) {
switch ($numParams) {
case 0:
$fResult = $fnName();
break;
case 1:
$fResult = $fnName($arg1);
break;
case 2:
$fResult = $fnName($arg1, $arg2);
break;
case 3:
$fResult = $fnName($arg1, $arg2, $arg3);
break;
case 4:
$fResult = $fnName($arg1, $arg2, $arg3, $arg4);
break;
case 5:
$fResult = $fnName($arg1, $arg2, $arg3, $arg4, $arg5);
break;
default:
CRM_Core_Error::fatal(ts('Invalid hook invocation'));
break;
if ($civiModules !== NULL) {
foreach ($civiModules as $module) {
$fnName = "{$module}_{$fnSuffix}";
if (function_exists($fnName)) {
switch ($numParams) {
case 0:
$fResult = $fnName();
break;
case 1:
$fResult = $fnName($arg1);
break;
case 2:
$fResult = $fnName($arg1, $arg2);
break;
case 3:
$fResult = $fnName($arg1, $arg2, $arg3);
break;
case 4:
$fResult = $fnName($arg1, $arg2, $arg3, $arg4);
break;
case 5:
$fResult = $fnName($arg1, $arg2, $arg3, $arg4, $arg5);
break;
default:
CRM_Core_Error::fatal(ts('Invalid hook invocation'));
break;
}
}
}
if (!empty($fResult) &&
if (!empty($fResult) &&
is_array($fResult)) {
$result = array_merge($result, $fResult);
$result = array_merge($result, $fResult);
}
}
}
......
......@@ -85,12 +85,14 @@ class CRM_Utils_Hook_Drupal extends CRM_Utils_Hook {
}
// we should add civicrm's module's just after main civicrm drupal module
foreach($this->drupalModules as $moduleName) {
$this->allModules[$moduleName] = $moduleName;
if ( $moduleName == 'civicrm' ) {
if (!empty($this->civiModules)) {
foreach( $this->civiModules as $civiModuleName) {
$this->allModules[$civiModuleName] = $civiModuleName;
if ($this->drupalModules !== NULL) {
foreach ($this->drupalModules as $moduleName) {
$this->allModules[$moduleName] = $moduleName;
if ( $moduleName == 'civicrm' ) {
if (!empty($this->civiModules)) {
foreach( $this->civiModules as $civiModuleName) {
$this->allModules[$civiModuleName] = $civiModuleName;
}
}
}
}
......
This diff is collapsed.
......@@ -1462,24 +1462,24 @@ format=[csv or print] optional-output CSV or print-friendly HTML, else PDF{/ts}'
( @domainID, 'Daily' , NULL, '{ts escape="sql" skip="true"}Disable expired relationships{/ts}','{ts escape="sql" skip="true"}Disables relationships that have expired (ie. those relationships whose end date is in the past).{/ts}', 'job', 'disable_expired_relationships', NULL, 0),
( @domainID, 'Daily' , NULL, '{ts escape="sql" skip="true"}Validate Email Address from Mailings.{/ts}', '{ts escape="sql" skip="true"}Updates the reset_date on an email address to indicate that there was a valid delivery to this email address.{/ts}', 'mailing', 'update_email_resetdate', '{ts escape="sql" skip="true"}minDays, maxDays=Consider mailings that have completed between minDays and maxDays{/ts}', 0);
SELECT @option_value_rel_id := value FROM `civicrm_option_value` WHERE `option_group_id` = @option_group_id_arel AND `name` = 'Income Account is';
SELECT @option_value_rel_id_exp := value FROM `civicrm_option_value` WHERE `option_group_id` = @option_group_id_arel AND `name` = 'Expense Account is';
SELECT @option_value_rel_id_ar := value FROM `civicrm_option_value` WHERE `option_group_id` = @option_group_id_arel AND `name` = 'Accounts Receivable Account is';
SELECT @option_value_rel_id_as := value FROM `civicrm_option_value` WHERE `option_group_id` = @option_group_id_arel AND `name` = 'Asset Account is';
SELECT @financial_type_id_dtn := max(id) FROM `civicrm_financial_type` WHERE `name` = 'Donation';
SELECT @financial_type_id_md := max(id) FROM `civicrm_financial_type` WHERE `name` = 'Member Dues';
SELECT @financial_type_id_cc := max(id) FROM `civicrm_financial_type` WHERE `name` = 'Campaign Contribution';
SELECT @financial_type_id_ef := max(id) FROM `civicrm_financial_type` WHERE `name` = 'Event Fee';
SELECT @financial_account_id_dtn := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Donation';
SELECT @financial_account_id_md := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Member Dues';
SELECT @financial_account_id_cc := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Campaign Contribution';
SELECT @financial_account_id_ef := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Event Fee';
SELECT @financial_account_id_bf := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Banking Fees';
SELECT @financial_account_id_ap := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Accounts Receivable';
SELECT @financial_account_id_ar := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Deposit Bank Account';
SELECT @financial_account_id_pp := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Payment Processor Account';
SELECT @option_value_rel_id := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Income Account is';
SELECT @option_value_rel_id_exp := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Expense Account is';
SELECT @option_value_rel_id_ar := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Accounts Receivable Account is';
SELECT @option_value_rel_id_as := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Asset Account is';
SELECT @financial_type_id_dtn := max(id) FROM civicrm_financial_type WHERE name = '{ts escape="sql"}Donation{/ts}';
SELECT @financial_type_id_md := max(id) FROM civicrm_financial_type WHERE name = '{ts escape="sql"}Member Dues{/ts}';
SELECT @financial_type_id_cc := max(id) FROM civicrm_financial_type WHERE name = '{ts escape="sql"}Campaign Contribution{/ts}';
SELECT @financial_type_id_ef := max(id) FROM civicrm_financial_type WHERE name = '{ts escape="sql"}Event Fee{/ts}';
SELECT @financial_account_id_dtn := max(id) FROM civicrm_financial_account WHERE name = '{ts escape="sql"}Donation{/ts}';
SELECT @financial_account_id_md := max(id) FROM civicrm_financial_account WHERE name = '{ts escape="sql"}Member Dues{/ts}';
SELECT @financial_account_id_cc := max(id) FROM civicrm_financial_account WHERE name = '{ts escape="sql"}Campaign Contribution{/ts}';
SELECT @financial_account_id_ef := max(id) FROM civicrm_financial_account WHERE name = '{ts escape="sql"}Event Fee{/ts}';
SELECT @financial_account_id_bf := max(id) FROM civicrm_financial_account WHERE name = '{ts escape="sql"}Banking Fees{/ts}';
SELECT @financial_account_id_ap := max(id) FROM civicrm_financial_account WHERE name = '{ts escape="sql"}Accounts Receivable{/ts}';
SELECT @financial_account_id_ar := max(id) FROM civicrm_financial_account WHERE name = '{ts escape="sql"}Deposit Bank Account{/ts}';
SELECT @financial_account_id_pp := max(id) FROM civicrm_financial_account WHERE name = '{ts escape="sql"}Payment Processor Account{/ts}';
INSERT INTO `civicrm_entity_financial_account`
( entity_table, entity_id, account_relationship, financial_account_id )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment