diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php index b0e9fb6..ee8ec99 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -606,7 +606,7 @@ public function submitForm(array &$form, array &$form_state) { ); try { - field_create_instance($instance); + $new_instance = field_create_instance($instance); // Make sure the field is displayed in the 'default' view mode (using // default formatter and settings). It stays hidden for other view @@ -615,7 +615,7 @@ public function submitForm(array &$form, array &$form_state) { ->setComponent($field['field_name']) ->save(); - $destinations[] = $this->adminPath . '/fields/' . $instance['field_name']; + $destinations[] = $this->adminPath . '/fields/' . $new_instance->id(); // Store new field information for any additional submit handlers. $form_state['fields_added']['_add_existing_field'] = $instance['field_name']; } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldWidgetTypeForm.php b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldWidgetTypeForm.php index 5af64ec..ca944b9 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldWidgetTypeForm.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldWidgetTypeForm.php @@ -63,9 +63,6 @@ public function buildForm(array $form, array &$form_state, FieldInstance $field_ $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Continue')); - $form['#validate'] = array(); - $form['#submit'] = array('field_ui_widget_type_form_submit'); - return $form; } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php index ee58051..3fcabf2 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php @@ -321,7 +321,7 @@ function testDeleteField() { $this->fieldUIAddExistingField($bundle_path2, $edit2); // Delete the first instance. - $this->fieldUIDeleteField($bundle_path1, $this->field_name, $this->field_label, $this->type); + $this->fieldUIDeleteField($bundle_path1, "node.$this->type.$this->field_name", $this->field_label, $this->type); // Reset the fields info. field_info_cache_clear(); @@ -331,7 +331,7 @@ function testDeleteField() { $this->assertNotNull(field_info_field($this->field_name), 'Field was not deleted.'); // Delete the second instance. - $this->fieldUIDeleteField($bundle_path2, $this->field_name, $this->field_label, $type_name2); + $this->fieldUIDeleteField($bundle_path2, "node.$type_name2.$this->field_name", $this->field_label, $type_name2); // Reset the fields info. field_info_cache_clear(); @@ -413,7 +413,7 @@ function testDuplicateFieldName() { */ function testWidgetChange() { $url_fields = 'admin/structure/types/manage/article/fields'; - $url_tags_widget = $url_fields . '/field_tags/widget-type'; + $url_tags_widget = $url_fields . '/node.article.field_tags/widget-type'; // Check that the field_tags field currently uses the 'options_select' // widget. @@ -464,7 +464,7 @@ function testDeleteTaxonomyField() { $this->fieldUIAddNewField($bundle_path, $edit1); // Delete the field. - $this->fieldUIDeleteField($bundle_path, $this->field_name, $this->field_label, 'Tags'); + $this->fieldUIDeleteField($bundle_path, "taxonomy_term.tags.$this->field_name", $this->field_label, 'Tags'); // Reset the fields info. field_info_cache_clear(); diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php index 352ce4b..606556f 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php @@ -220,7 +220,7 @@ function testPrivateFileSetting() { // Change the field setting to make its files private, and upload a file. $edit = array('field[settings][uri_scheme]' => 'private'); - $this->drupalPost("admin/structure/types/manage/$type_name/fields/$field_name/field-settings", $edit, t('Save field settings')); + $this->drupalPost("admin/structure/types/manage/$type_name/fields/$instance->id/field-settings", $edit, t('Save field settings')); $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); $node = node_load($nid, TRUE); $node_file = file_load($node->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid']); @@ -232,12 +232,12 @@ function testPrivateFileSetting() { // Ensure we can't change 'uri_scheme' field settings while there are some // entities with uploaded files. - $this->drupalGet("admin/structure/types/manage/$type_name/fields/$field_name/field-settings"); + $this->drupalGet("admin/structure/types/manage/$type_name/fields/$instance->id/field-settings"); $this->assertFieldByXpath('//input[@id="edit-field-settings-uri-scheme-public" and @disabled="disabled"]', 'public', t('Upload destination setting disabled.')); // Delete node and confirm that setting could be changed. node_delete($nid); - $this->drupalGet("admin/structure/types/manage/$type_name/fields/$field_name/field-settings"); + $this->drupalGet("admin/structure/types/manage/$type_name/fields/$instance->id/field-settings"); $this->assertFieldByXpath('//input[@id="edit-field-settings-uri-scheme-public" and not(@disabled)]', 'public', t('Upload destination setting enabled.')); } diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php index 7c42a5b..0f59f44 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php @@ -229,7 +229,7 @@ function testImageFieldDefaultImage() { $edit = array( 'files[field_settings_default_image]' => drupal_realpath($images[0]->uri), ); - $this->drupalPost("admin/structure/types/manage/article/fields/$field_name/field-settings", $edit, t('Save field settings')); + $this->drupalPost("admin/structure/types/manage/article/fields/node.article.$field_name/field-settings", $edit, t('Save field settings')); // Clear field info cache so the new default image is detected. field_info_cache_clear(); $field = field_info_field($field_name); @@ -257,7 +257,7 @@ function testImageFieldDefaultImage() { $edit = array( 'field[settings][default_image][fid]' => 0, ); - $this->drupalPost("admin/structure/types/manage/article/fields/$field_name/field-settings", $edit, t('Save field settings')); + $this->drupalPost("admin/structure/types/manage/article/fields/node.article.$field_name/field-settings", $edit, t('Save field settings')); // Clear field info cache so the new default image is detected. field_info_cache_clear(); $field = field_info_field($field_name); @@ -270,7 +270,7 @@ function testImageFieldDefaultImage() { $edit = array( 'files[field_settings_default_image]' => drupal_realpath($images[1]->uri), ); - $this->drupalPost('admin/structure/types/manage/article/fields/' . $private_field_name . '/field-settings', $edit, t('Save field settings')); + $this->drupalPost('admin/structure/types/manage/article/fields/node.article.' . $private_field_name . '/field-settings', $edit, t('Save field settings')); // Clear field info cache so the new default image is detected. field_info_cache_clear(); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php index 0db0bda..452ed93 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php @@ -75,7 +75,7 @@ function testNodeAccessAdministerField() { $default = 'Sometimes words have two meanings'; $edit["{$this->field_name}[$langcode][0][value]"] = $default; $this->drupalPost( - "admin/structure/types/manage/page/fields/{$this->field_name}", + "admin/structure/types/manage/page/fields/node.page.{$this->field_name}", $edit, t('Save settings') ); diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php index 11f6035..62e541f 100644 --- a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php +++ b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php @@ -266,7 +266,7 @@ protected function createOptionsField($type) { ); field_create_instance($instance); - $this->admin_path = 'admin/structure/types/manage/' . $this->type . '/fields/' . $this->field_name . '/field-settings'; + $this->admin_path = 'admin/structure/types/manage/' . $this->type . '/fields/node/' . $this->type . '.' . $this->field_name . '/field-settings'; } /**