$description='<p>'.$this->t('These settings apply to the %field field everywhere it is used. These settings impact the way that data is stored in the database and cannot be changed once data has been created.',array('%field'=>$this->field->label())).'</p>';
$form['#prefix']='<p>'.$this->t('These settings apply to the %field field everywhere it is used. These settings impact the way that data is stored in the database and cannot be changed once data has been created.',array('%field'=>$field_label)).'</p>';
// See if data already exists for this field.
// If so, prevent changes to the field settings.
if($field_storage->hasData()){
$form['field_storage']['#prefix']='<div class="messages messages--error">'.$this->t('There is data for this field in the database. The field settings can no longer be changed.').'</div>'.$form['field_storage']['#prefix'];
if($this->entity->hasData()){
$form['#prefix']='<div class="messages messages--error">'.$this->t('There is data for this field in the database. The field settings can no longer be changed.').'</div>'.$form['#prefix'];
}
// Add settings provided by the field module. The field module is
// responsible for not returning settings that cannot be changed if
// the field already has data.
$form['field_storage']['settings']=array(
$form['settings']=array(
'#weight'=>-10,
'#tree'=>TRUE,
);
// Create an arbitrary entity object, so that we can have an instantiated
drupal_set_message($this->t('Attempt to update field %label failed: %message.',array('%label'=>$this->field->label(),'%message'=>$e->getMessage())),'error');
drupal_set_message($this->t('Attempt to update field %label failed: %message.',array('%label'=>$field_label,'%message'=>$e->getMessage())),'error');
@@ -297,7 +297,7 @@ function testImageFieldSettings() {
// 1, so we need to make sure the file widget prevents these notices by
// providing all settings, even if they are not used.
// @see FileWidget::formMultipleElements().
$this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.'.$field_name.'/storage',array('field_storage[cardinality]'=>FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED),t('Save field settings'));
$this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.'.$field_name.'/storage',array('cardinality'=>FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED),t('Save field settings'));