summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-02-05 22:11:26 +0000
committerDries Buytaert <dries@buytaert.net>2010-02-05 22:11:26 +0000
commit49db9562fa98425ce61729b233301d4242deab4e (patch)
tree0158ff4aace7df4ad6d59e7c4df8e63ff9697d3f
parent4bacfbd512e13fc032535073e5ef36bbb25cb096 (diff)
downloadbrdo-49db9562fa98425ce61729b233301d4242deab4e.tar.gz
brdo-49db9562fa98425ce61729b233301d4242deab4e.tar.bz2
- Patch #705420 by catch: add field name to create instance exception.
-rw-r--r--modules/field/field.crud.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc
index e8a48008b..b69baff28 100644
--- a/modules/field/field.crud.inc
+++ b/modules/field/field.crud.inc
@@ -609,7 +609,7 @@ function field_delete_field($field_name) {
function field_create_instance($instance) {
$field = field_read_field($instance['field_name']);
if (empty($field)) {
- throw new FieldException("Attempt to create an instance of a field that doesn't exist or is currently inactive.");
+ throw new FieldException(t("Attempt to create an instance of a field @field_name that doesn't exist or is currently inactive.", array('@field_name' => $instance['field_name'])));
}
// Check that the required properties exists.
if (empty($instance['object_type'])) {
@@ -641,7 +641,7 @@ function field_create_instance($instance) {
// a disabled field is not supported.
$prior_instance = field_read_instance($instance['object_type'], $instance['field_name'], $instance['bundle']);
if (!empty($prior_instance)) {
- $message = t('Attempt to create a field instance that already exists.');
+ $message = t('Attempt to create an instance of field @field_name on bundle @bundle that already has an instance of that field.', array('@field_name' => $instance['field_name'], '@bundle' => $instance['bundle']));
throw new FieldException($message);
}