diff options
author | David Rothstein <drothstein@gmail.com> | 2014-11-03 11:50:54 -0500 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2014-11-03 11:50:54 -0500 |
commit | f609f390af91ccbad813134d0eb0b054e85dc1c5 (patch) | |
tree | f4b52c8b858eb1edfece5a1e526706cdbd65b5dc /modules/field | |
parent | c2b05dd9c0109b8d417c8140883e1808400f0503 (diff) | |
download | brdo-f609f390af91ccbad813134d0eb0b054e85dc1c5.tar.gz brdo-f609f390af91ccbad813134d0eb0b054e85dc1c5.tar.bz2 |
Issue #1231710 by cs_shadow, Hydra, dcam, kathyh, klausi, mlncn: Fixed Field exceptions should return the name of the field that has exceptions.
Diffstat (limited to 'modules/field')
-rw-r--r-- | modules/field/field.crud.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc index e4486d03f..ba3770832 100644 --- a/modules/field/field.crud.inc +++ b/modules/field/field.crud.inc @@ -60,11 +60,11 @@ function field_create_field($field) { } // Field type is required. if (empty($field['type'])) { - throw new FieldException('Attempt to create a field with no type.'); + throw new FieldException(format_string('Attempt to create field @field_name with no type.', array('@field_name' => $field['field_name']))); } // Field name cannot contain invalid characters. if (!preg_match('/^[_a-z]+[_a-z0-9]*$/', $field['field_name'])) { - throw new FieldException('Attempt to create a field with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character'); + throw new FieldException(format_string('Attempt to create a field @field_name with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character', array('@field_name' => $field['field_name']))); } // Field name cannot be longer than 32 characters. We use drupal_strlen() |