display a warning instead of an error if the project_id is a duplicate
This commit is contained in:
parent
96c072eb8e
commit
8d1d93d77a
2 changed files with 8 additions and 2 deletions
|
@ -568,7 +568,13 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form {
|
||||||
$profile->validate();
|
$profile->validate();
|
||||||
}
|
}
|
||||||
catch (ProfileValidationError $e) {
|
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'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -296,7 +296,7 @@ class CRM_Twingle_Profile {
|
||||||
2 => $profile->getName()
|
2 => $profile->getName()
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
ProfileValidationError::ERROR_CODE_PROFILE_VALIDATION_FAILED
|
ProfileValidationError::ERROR_CODE_PROFILE_VALIDATION_WARNING
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue