Skip to content
Snippets Groups Projects
Unverified Commit 8a9d70df authored by colemanw's avatar colemanw Committed by GitHub
Browse files

Merge pull request #31766 from mlutfy/cgSubtypeDisabled

CustomGroup: provide a more helpful message when a extendsChildType fails to validate
parents 97e1c2eb 08c42e72
Branches
Tags
No related merge requests found
......@@ -201,13 +201,13 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup implements \Civi
if (is_array($extendsChildType)) {
foreach ($extendsChildType as $childType) {
if (!array_key_exists($childType, $registeredSubTypes) && !in_array($childType, $registeredSubTypes, TRUE)) {
throw new CRM_Core_Exception('Supplied Sub type is not valid for the specified entity');
throw new CRM_Core_Exception(ts('The Sub Type ID %1 is not valid for the specified entity or it has been disabled. If the Sub Type was disabled, re-enable it temporarily and re-save this form in order to remove the setting.', [1 => $childType]));
}
}
}
else {
if (!array_key_exists($extendsChildType, $registeredSubTypes) && !in_array($extendsChildType, $registeredSubTypes, TRUE)) {
throw new CRM_Core_Exception('Supplied Sub type is not valid for the specified entity');
throw new CRM_Core_Exception(ts('The Sub Type ID %1 is not valid for the specified entity or it has been disabled. If the Sub Type was disabled, re-enable it temporarily and re-save this form in order to remove the setting.', [1 => $childType]));
}
$extendsChildType = [$extendsChildType];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment