diff --git a/core/modules/views/src/Plugin/views/field/EntityOperations.php b/core/modules/views/src/Plugin/views/field/EntityOperations.php index 974d3fbd845..f2a3ba997cd 100644 --- a/core/modules/views/src/Plugin/views/field/EntityOperations.php +++ b/core/modules/views/src/Plugin/views/field/EntityOperations.php @@ -165,4 +165,11 @@ class EntityOperations extends FieldPluginBase { return $this->view; } + /** + * {@inheritdoc} + */ + public function clickSortable() { + return FALSE; + } + } diff --git a/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php b/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php index d5adcb409e3..e76d54e34b2 100644 --- a/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php +++ b/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php @@ -25,7 +25,7 @@ class FieldEntityOperationsTest extends HandlerTestBase { * * @var array */ - public static $modules = array('node', 'language'); + public static $modules = array('node', 'language', 'views_ui'); function setUp() { parent::setUp(); @@ -83,6 +83,11 @@ class FieldEntityOperationsTest extends HandlerTestBase { } } } + + // Test that we can't enable click sorting on the operation field. + $this->drupalGet('admin/structure/views/nojs/display/test_entity_operations/page_2/style_options'); + $this->assertField('style_options[info][title][sortable]'); + $this->assertNoField('style_options[info][operations][sortable]'); } } diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_operations.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_operations.yml index 8276613a349..bb84119f071 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_operations.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_operations.yml @@ -123,3 +123,46 @@ display: position: null display_options: path: test-entity-operations + page_2: + display_plugin: page + id: page_2 + display_title: 'Page 2' + position: null + display_options: + path: test-entity-operations-table + style: + type: table + options: + grouping: { } + row_class: '' + default_row_class: true + override: true + sticky: false + caption: '' + summary: '' + description: '' + columns: + title: title + operations: operations + info: + title: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + operations: + align: '' + separator: '' + empty_column: false + responsive: '' + default: '-1' + empty_table: false + row: + type: fields + options: { } + display_extenders: { } + defaults: + style: false + row: false