thrownewFieldException(t('Attempt to create field name %name which is reserved by entity type %type.',array('%name'=>$field['field_name'],'%type'=>$type)));
}
}
$field+=array(
'object_types'=>array(),
'entity_types'=>array(),
'cardinality'=>1,
'translatable'=>FALSE,
'locked'=>FALSE,
...
...
@@ -403,8 +403,8 @@ function field_update_field($field) {
if($field['type']!=$prior_field['type']){
thrownewFieldException("Cannot change an existing field's type.");
thrownewFieldException("Cannot change an existing field's storage type.");
...
...
@@ -588,7 +588,7 @@ function field_delete_field($field_name) {
* Creates an instance of a field, binding it to a bundle.
*
* @param $instance
* A field instance definition array. The field_name, object_type and
* A field instance definition array. The field_name, entity_type and
* bundle properties are required. Other properties, if omitted,
* will be given the following default values:
* - label: the field name
...
...
@@ -620,15 +620,15 @@ function field_create_instance($instance) {
thrownewFieldException(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'])){
if(empty($instance['entity_type'])){
thrownewFieldException(t('Attempt to create an instance of field @field_name without an object type.',array('@field_name'=>$instance['field_name'])));
}
if(empty($instance['bundle'])){
thrownewFieldException(t('Attempt to create an instance of field @field_name without a bundle.',array('@field_name'=>$instance['field_name'])));
}
// Check that the field can be attached to this entity type.
thrownewFieldException(t('Attempt to create an instance of field @field_name on forbidden object type @obj_type.',array('@field_name'=>$instance['field_name'],'@obj_type'=>$instance['object_type'])));
thrownewFieldException(t('Attempt to create an instance of field @field_name on forbidden object type @entity_type.',array('@field_name'=>$instance['field_name'],'@entity_type'=>$instance['entity_type'])));
}
// Set the field id.
...
...
@@ -647,7 +647,7 @@ function field_create_instance($instance) {
// Ensure the field instance is unique within the bundle.
// We only check for instances of active fields, since adding an instance of
$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']));
thrownewFieldException($message);
...
...
@@ -688,7 +688,7 @@ function field_update_instance($instance) {
// Check that the field instance exists (even if it is inactive, since we
// want to be able to replace inactive widgets with new ones).