diff --git a/CRM/Twingle/Form/Profile.php b/CRM/Twingle/Form/Profile.php index 0412b1c..245091f 100644 --- a/CRM/Twingle/Form/Profile.php +++ b/CRM/Twingle/Form/Profile.php @@ -568,7 +568,13 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form { $profile->validate(); } catch (ProfileValidationError $e) { - $this->setElementError($e->getAffectedFieldName(), $e->getMessage()); + switch ($e->getErrorCode()) { + case ProfileValidationError::ERROR_CODE_PROFILE_VALIDATION_FAILED: + $this->setElementError($e->getAffectedFieldName(), $e->getMessage()); + break; + case ProfileValidationError::ERROR_CODE_PROFILE_VALIDATION_WARNING: + CRM_Core_Session::setStatus($e->getMessage(), E::ts('Warning')); + } } } diff --git a/CRM/Twingle/Profile.php b/CRM/Twingle/Profile.php index dddee4e..35373a1 100644 --- a/CRM/Twingle/Profile.php +++ b/CRM/Twingle/Profile.php @@ -296,7 +296,7 @@ class CRM_Twingle_Profile { 2 => $profile->getName() ] ), - ProfileValidationError::ERROR_CODE_PROFILE_VALIDATION_FAILED + ProfileValidationError::ERROR_CODE_PROFILE_VALIDATION_WARNING ); } }