diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Data.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Data.php index 1f4d4aa..04e0d45 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Data.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Data.php @@ -115,6 +115,10 @@ protected function defineOptions() { $options['defaults']['default']['style'] = FALSE; $options['defaults']['default']['row'] = FALSE; + // Remove css/exposed form settings, as they are not used for the data display. + unset($options['exposed_form']); + unset($options['css_class']); + return $options; } @@ -138,8 +142,14 @@ public function optionsSummary(&$categories, &$options) { $options['path']['category'] = 'path'; $options['path']['title'] = t('Path'); + + // Remove css/exposed form settings, as they are not used for the data display. + unset($options['exposed_form']); + unset($options['css_class']); } + + /** * Overrides Drupal\views\Plugin\views\display\PathPluginBase::execute(). */ diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleSerializeTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleSerializeTest.php index ac7af96..33d74c6 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleSerializeTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleSerializeTest.php @@ -20,7 +20,7 @@ class StyleSerializeTest extends PluginTestBase { * * @var array */ - public static $modules = array('views_ui', 'entity_test'); + public static $modules = array('views_ui', 'entity_test', 'jsonld'); /** * Views used by this test. @@ -29,6 +29,11 @@ class StyleSerializeTest extends PluginTestBase { */ public static $testViews = array('test_serialize_display_field', 'test_serialize_display_entity'); + /** + * A user with administrative privileges to look at test entity and configure views. + */ + protected $adminUser; + public static function getInfo() { return array( 'name' => 'Style: Serializer plugin', @@ -90,17 +95,25 @@ public function testSerializeResponses() { // Get the serializer service. $serializer = drupal_container()->get('serializer'); - $expected = array(); + $entities = array(); foreach ($view->result as $row) { - $expected[] = $row->_entity; + $entities[] = $row->_entity; } - $expected = $serializer->serialize($expected, 'json'); + $expected = $serializer->serialize($entities, 'json'); $actual_json = $this->drupalGet('test/serialize/entity', array(), array('Accept: application/json')); $this->assertResponse(200); $this->assertIdentical($actual_json, $expected, 'The expected JSON output was found.'); + + $expected = $serializer->serialize($entities, 'jsonld'); + $actual_json = $this->drupalGet('test/serialize/entity', array(), array('Accept: application/ld+json')); + $this->assertIdentical($actual_json, $expected, 'The expected JSONLD output was found.'); + + $expected = $serializer->serialize($entities, 'drupal_jsonld'); + $actual_json = $this->drupalGet('test/serialize/entity', array(), array('Accept: application/vnd.drupal.ld+json')); + $this->assertIdentical($actual_json, $expected, 'The expected JSONLD output was found.'); } /** diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index c8a2c96..925202f 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -816,10 +816,16 @@ public function getFormBucket(ViewUI $view, $type, $display) { $build['#name'] = $build['#title'] = $types[$type]['title']; + $rearrange_url = "admin/structure/views/nojs/rearrange/{$view->get('name')}/{$display['id']}/$type"; + $rearrange_text = t('Rearrange'); + $class = 'icon compact rearrange'; + // Different types now have different rearrange forms, so we use this switch // to get the right one. switch ($type) { case 'filter': + // The rearrange form for filters contains the and/or UI, so override + // the used path. $rearrange_url = "admin/structure/views/nojs/rearrange-$type/{$view->get('name')}/{$display['id']}/$type"; $rearrange_text = t('And/Or, Rearrange'); // TODO: Add another class to have another symbol for filter rearrange. @@ -837,6 +843,7 @@ public function getFormBucket(ViewUI $view, $type, $display) { ); return $build; } + break; case 'header': case 'footer': case 'empty': @@ -848,10 +855,7 @@ public function getFormBucket(ViewUI $view, $type, $display) { ); return $build; } - default: - $rearrange_url = "admin/structure/views/nojs/rearrange/{$view->get('name')}/{$display['id']}/$type"; - $rearrange_text = t('Rearrange'); - $class = 'icon compact rearrange'; + break; } // Create an array of actions to pass to theme_links