Add user interface messages on creation fails during installation

This commit is contained in:
Marc Michalsky forumZFD 2021-02-25 17:40:28 +01:00
parent 26d4497dbe
commit 681aed959e
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
3 changed files with 38 additions and 4 deletions

View file

@ -79,6 +79,9 @@ class CRM_TwingleCampaign_BAO_OptionValue {
}
// If the option value could not get created: log error
else {
CRM_Utils_System::setUFMessage(ts("Creation of custom value '%1'
failed. Find more information in the logs.",
$this->name));
if ($this->label && $this->option_group_id) {
Civi::log()
->error("$this->extensionName could not create new option value
@ -93,6 +96,16 @@ class CRM_TwingleCampaign_BAO_OptionValue {
}
}
}
else {
CRM_Utils_System::setUFMessage(ts("Creation of custom value '%1'
failed, because a custom value with that name already exists.
Find more information in the logs.",
$this->name));
Civi::log()
->error("$this->extensionName could not create new custom value
\"$this->name\" for group \"$this->option_group_id\" because a
value with that name already exists.");
}
}