set empty value for 'project_type' to 'default'

This commit is contained in:
Marc Michalsky forumZFD 2020-12-15 14:59:25 +01:00
parent 45e42fbde8
commit 700b33f1b9
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -410,11 +410,12 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
* Returns a response array that contains title, id, project_id and status * Returns a response array that contains title, id, project_id and status
*/ */
public function getResponse(string $status) { public function getResponse(string $status) {
$project_type = empty($this->values['type']) ? 'default' : $this->values['type'];
return [ return [
'title' => $this->values['name'], 'title' => $this->values['name'],
'id' => (int) $this->id, 'id' => (int) $this->id,
'project_id' => (int) $this->values['id'], 'project_id' => (int) $this->values['id'],
'project_type' => $this->values['type'], 'project_type' => $project_type,
'status' => $status, 'status' => $status,
]; ];
} }