Skip to content
Snippets Groups Projects
Commit 0a0e884e authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2465031 by damiankloip: Do not allow UUID field to be click sortable

parent 56bf9226
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -491,6 +491,23 @@ protected function processViewsDataForTextLong($table, FieldDefinitionInterface ...@@ -491,6 +491,23 @@ protected function processViewsDataForTextLong($table, FieldDefinitionInterface
} }
} }
/**
* Processes the views data for a UUID field.
*
* @param string $table
* The table the field is added to.
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition.
* @param array $views_field
* The views field data.
* @param string $field_column_name
* The field column being processed.
*/
protected function processViewsDataForUuid($table, FieldDefinitionInterface $field_definition, array &$views_field, $field_column_name) {
// It does not make sense for UUID fields to be click sortable.
$views_field['field']['click sortable'] = FALSE;
}
/** /**
* Gets the table of an entity type to be used as base table in views. * Gets the table of an entity type to be used as base table in views.
* *
......
...@@ -766,6 +766,7 @@ protected function assertLongTextField($data, $field_name) { ...@@ -766,6 +766,7 @@ protected function assertLongTextField($data, $field_name) {
protected function assertUuidField($data) { protected function assertUuidField($data) {
// @todo Can we provide additional support for UUIDs in views? // @todo Can we provide additional support for UUIDs in views?
$this->assertEquals('field', $data['field']['id']); $this->assertEquals('field', $data['field']['id']);
$this->assertFalse($data['field']['click sortable']);
$this->assertEquals('string', $data['filter']['id']); $this->assertEquals('string', $data['filter']['id']);
$this->assertEquals('string', $data['argument']['id']); $this->assertEquals('string', $data['argument']['id']);
$this->assertEquals('standard', $data['sort']['id']); $this->assertEquals('standard', $data['sort']['id']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment