summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-06-03 13:08:52 +0000
committerDries Buytaert <dries@buytaert.net>2010-06-03 13:08:52 +0000
commit2276295fd633482032d6125c22b84e6c8b9d020a (patch)
tree78ca69265858e855a9a04dea1395312d4c94a968
parenta7a0ee83605f8875123bf266b8aed5865732027d (diff)
downloadbrdo-2276295fd633482032d6125c22b84e6c8b9d020a.tar.gz
brdo-2276295fd633482032d6125c22b84e6c8b9d020a.tar.bz2
- Patch #816642 by catch: improved field exceptions.
-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 3de0963bf..f49972248 100644
--- a/modules/field/field.crud.inc
+++ b/modules/field/field.crud.inc
@@ -704,14 +704,14 @@ function field_update_instance($instance) {
// Check that the specified field exists.
$field = field_read_field($instance['field_name']);
if (empty($field)) {
- throw new FieldException("Attempt to update an instance of a nonexistent field.");
+ throw new FieldException(t('Attempt to update an instance of a nonexistent field @field.', array('@field' => $instance['field_name'])));
}
// Check that the field instance exists (even if it is inactive, since we
// want to be able to replace inactive widgets with new ones).
$prior_instance = field_read_instance($instance['entity_type'], $instance['field_name'], $instance['bundle'], array('include_inactive' => TRUE));
if (empty($prior_instance)) {
- throw new FieldException("Attempt to update a field instance that doesn't exist.");
+ throw new FieldException(t("Attempt to update an instance of field @field on bundle @bundle that doesn't exist.", array('@field' => $instance['field_name'], '@bundle' => $instance['bundle'])));
}
$instance['id'] = $prior_instance['id'];