Improve error message for "possibly mandatory" exception.
authorChris Burgess <chris@giantrobot.co.nz>
Thu, 15 Dec 2016 03:29:22 +0000 (16:29 +1300)
committerChris Burgess <chris@giantrobot.co.nz>
Thu, 15 Dec 2016 03:32:23 +0000 (16:32 +1300)
CRM-19772

api/v3/utils.php

index fe194a921f8f431f941692e4dbf1ae920a100ff4..ddf19f85ea136efda8f98ff89e18a89fb0cef019 100644 (file)
@@ -1637,7 +1637,7 @@ function _civicrm_api3_validate_foreign_keys($entity, $action, &$params, $fields
         _civicrm_api3_validate_constraint($params[$fieldName], $fieldName, $fieldInfo);
       }
       elseif (!empty($fieldInfo['required'])) {
-        throw new Exception("DB Constraint Violation - possibly $fieldName should possibly be marked as mandatory for this API. If so, please raise a bug report.");
+        throw new Exception("DB Constraint Violation - $fieldName should possibly be marked as mandatory for $entity,$action API. If so, please raise a bug report.");
       }
     }
     if (!empty($fieldInfo['api.unique'])) {