Commit aefca7b8 authored by alexpott's avatar alexpott

Issue #2858852 by tim.plunkett: [8.3.x regression] Extra fields cannot be used...

Issue #2858852 by tim.plunkett: [8.3.x regression] Extra fields cannot be used with tabledrag in Manage Display
parent 012bca19
......@@ -268,7 +268,7 @@
this.defaultPlugin = data.defaultPlugin;
// Attach change listener to the 'plugin type' select.
this.$pluginSelect = $(row).find('select.field-plugin-type');
this.$pluginSelect = $(row).find('.field-plugin-type');
this.$pluginSelect.on('change', Drupal.fieldUIOverview.onChange);
// Attach change listener to the 'region' select.
......
......@@ -497,7 +497,14 @@ protected function buildExtraFieldRow($field_id, $extra_field) {
'#default_value' => $display_options ? $display_options['region'] : 'hidden',
'#attributes' => ['class' => ['field-region']],
],
'plugin' => [],
'plugin' => [
'type' => [
'#type' => 'hidden',
'#value' => $display_options ? 'visible' : 'hidden',
'#parents' => ['fields', $field_id, 'type'],
'#attributes' => ['class' => ['field-plugin-type']],
],
],
'settings_summary' => [],
'settings_edit' => [],
];
......
......@@ -86,4 +86,21 @@ public function testEntityView() {
$this->assertSession()->elementExists('css', '.field--name-field-test-text');
}
/**
* Tests extra fields.
*/
public function testExtraFields() {
entity_test_create_bundle('bundle_with_extra_fields');
$this->drupalGet('entity_test/structure/bundle_with_extra_fields/display');
$extra_field_row = $this->getSession()->getPage()->find('css', '#display-extra-field');
$disabled_region_row = $this->getSession()->getPage()->find('css', '.region-hidden-title');
$extra_field_row->find('css', '.handle')->dragTo($disabled_region_row);
$this->assertSession()->assertWaitOnAjaxRequest();
$this->submitForm([], 'Save');
$this->assertSession()->pageTextContains('Your settings have been saved.');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment