👾 bug fix: wrong parent TwingleProject id's
This commit is contained in:
parent
e23e0d7e8d
commit
f059abf5a8
3 changed files with 20 additions and 18 deletions
|
@ -61,11 +61,10 @@ function civicrm_api3_twingle_campaign_Create(array $params): array {
|
|||
_civicrm_api3_twingle_campaign_Create_spec($allowed_params);
|
||||
$params = array_intersect_key($params, $allowed_params);
|
||||
|
||||
// instantiate TwingleCampaign
|
||||
$campaign = new TwingleCampaign($params);
|
||||
|
||||
// Try to create the TwingleCampaign
|
||||
try {
|
||||
// instantiate TwingleCampaign
|
||||
$campaign = new TwingleCampaign($params);
|
||||
// try to create the TwingleCampaign
|
||||
$campaign->create(TRUE);
|
||||
return civicrm_api3_create_success(
|
||||
$campaign->getResponse('TwingleCampaign created'),
|
||||
|
@ -74,15 +73,8 @@ function civicrm_api3_twingle_campaign_Create(array $params): array {
|
|||
'Create'
|
||||
);
|
||||
} catch(Exception $e){
|
||||
Civi::log()->error(
|
||||
E::LONG_NAME .
|
||||
' could not create TwingleCampaign: ' .
|
||||
$e->getMessage(),
|
||||
$campaign->getResponse()
|
||||
);
|
||||
return civicrm_api3_create_error(
|
||||
'Could not create TwingleCampaign: ' . $e->getMessage(),
|
||||
$campaign->getResponse()
|
||||
'Could not create TwingleCampaign: ' . $e->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue