when TwingleProject gets changed, sync all child TwingleCampaigns, too
This commit is contained in:
parent
e5efd76e66
commit
4e08af8c88
1 changed files with 8 additions and 0 deletions
|
@ -124,6 +124,14 @@ function twinglecampaign_postSave_callback (
|
|||
}
|
||||
}
|
||||
elseif ($entity == 'TwingleProject') {
|
||||
// Also synchronize all child TwingleCampaign campaigns
|
||||
try {
|
||||
civicrm_api3('TwingleCampaign', 'sync', ['project_id' => $campaign_id]);
|
||||
} catch (CiviCRM_API3_Exception $e) {
|
||||
Civi::log()->error(
|
||||
'twinglecampaign_postSave_callback ' . $e->getMessage()
|
||||
);
|
||||
}
|
||||
try {
|
||||
civicrm_api3('TwingleProject', 'sync', ['id' => $campaign_id]);
|
||||
CRM_Utils_System::setUFMessage('TwingleProject was saved.');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue