👾 bug fix: project id
This commit is contained in:
parent
1954f90f79
commit
4bcc4cf1fb
2 changed files with 12 additions and 3 deletions
|
@ -41,6 +41,15 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
|
|||
* CiviCRM Campaign id
|
||||
*/
|
||||
public function __construct(array $values = [], int $id = NULL) {
|
||||
|
||||
// If the $values originally come from the TwingleProject.get API, they
|
||||
// contain the internal CiviCRM id as 'id' and the external Twingle id as
|
||||
// 'project_id'. In this case 'id' gets replaced with 'project_id'
|
||||
if (isset($values['project_id'])) {
|
||||
$values['id'] = $values['project_id'];
|
||||
unset($values['project_id']);
|
||||
}
|
||||
|
||||
parent::__construct($values, $id);
|
||||
|
||||
$this->prefix = 'twingle_project_';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue