From 4feeb01611309c8385bdf08abe086354e726f885 Mon Sep 17 00:00:00 2001 From: Marc Michalsky Date: Wed, 6 Sep 2023 16:29:55 +0200 Subject: [PATCH] make sure that default values are present --- CRM/Twingle/Form/Profile.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Twingle/Form/Profile.php b/CRM/Twingle/Form/Profile.php index 5205b52..199e421 100644 --- a/CRM/Twingle/Form/Profile.php +++ b/CRM/Twingle/Form/Profile.php @@ -640,6 +640,9 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form { public function setDefaultValues() { $defaults = parent::setDefaultValues(); if (in_array($this->_op, ['create', 'edit', 'copy'])) { + if (!$this->profile) { + $this->profile = CRM_Twingle_Profile::createDefaultProfile()->copy(); + } $defaults['name'] = $this->profile->getName(); $profile_data = $this->profile->getData(); foreach ($profile_data as $element_name => $value) {