Issue #2735997 by ramil g, joelpittet, ranjith_kumar_k_u, asad_ahmed, nikita_tt, mschudders, Ben Greenberg, lendude, playful: Decimal separator and decimals settings ignored when aggregating decimal fields
parent
c8c538e760
commit
d15e2ea581
|
@ -1790,7 +1790,6 @@ class Sql extends QueryPluginBase {
|
||||||
'method' => 'aggregationMethodSimple',
|
'method' => 'aggregationMethodSimple',
|
||||||
'handler' => [
|
'handler' => [
|
||||||
'argument' => 'groupby_numeric',
|
'argument' => 'groupby_numeric',
|
||||||
'field' => 'numeric',
|
|
||||||
'filter' => 'groupby_numeric',
|
'filter' => 'groupby_numeric',
|
||||||
'sort' => 'groupby_numeric',
|
'sort' => 'groupby_numeric',
|
||||||
],
|
],
|
||||||
|
@ -1800,7 +1799,6 @@ class Sql extends QueryPluginBase {
|
||||||
'method' => 'aggregationMethodDistinct',
|
'method' => 'aggregationMethodDistinct',
|
||||||
'handler' => [
|
'handler' => [
|
||||||
'argument' => 'groupby_numeric',
|
'argument' => 'groupby_numeric',
|
||||||
'field' => 'numeric',
|
|
||||||
'filter' => 'groupby_numeric',
|
'filter' => 'groupby_numeric',
|
||||||
'sort' => 'groupby_numeric',
|
'sort' => 'groupby_numeric',
|
||||||
],
|
],
|
||||||
|
@ -1810,7 +1808,6 @@ class Sql extends QueryPluginBase {
|
||||||
'method' => 'aggregationMethodSimple',
|
'method' => 'aggregationMethodSimple',
|
||||||
'handler' => [
|
'handler' => [
|
||||||
'argument' => 'groupby_numeric',
|
'argument' => 'groupby_numeric',
|
||||||
'field' => 'numeric',
|
|
||||||
'filter' => 'groupby_numeric',
|
'filter' => 'groupby_numeric',
|
||||||
'sort' => 'groupby_numeric',
|
'sort' => 'groupby_numeric',
|
||||||
],
|
],
|
||||||
|
@ -1820,7 +1817,6 @@ class Sql extends QueryPluginBase {
|
||||||
'method' => 'aggregationMethodSimple',
|
'method' => 'aggregationMethodSimple',
|
||||||
'handler' => [
|
'handler' => [
|
||||||
'argument' => 'groupby_numeric',
|
'argument' => 'groupby_numeric',
|
||||||
'field' => 'numeric',
|
|
||||||
'filter' => 'groupby_numeric',
|
'filter' => 'groupby_numeric',
|
||||||
'sort' => 'groupby_numeric',
|
'sort' => 'groupby_numeric',
|
||||||
],
|
],
|
||||||
|
@ -1830,7 +1826,6 @@ class Sql extends QueryPluginBase {
|
||||||
'method' => 'aggregationMethodSimple',
|
'method' => 'aggregationMethodSimple',
|
||||||
'handler' => [
|
'handler' => [
|
||||||
'argument' => 'groupby_numeric',
|
'argument' => 'groupby_numeric',
|
||||||
'field' => 'numeric',
|
|
||||||
'filter' => 'groupby_numeric',
|
'filter' => 'groupby_numeric',
|
||||||
'sort' => 'groupby_numeric',
|
'sort' => 'groupby_numeric',
|
||||||
],
|
],
|
||||||
|
@ -1840,7 +1835,6 @@ class Sql extends QueryPluginBase {
|
||||||
'method' => 'aggregationMethodSimple',
|
'method' => 'aggregationMethodSimple',
|
||||||
'handler' => [
|
'handler' => [
|
||||||
'argument' => 'groupby_numeric',
|
'argument' => 'groupby_numeric',
|
||||||
'field' => 'numeric',
|
|
||||||
'filter' => 'groupby_numeric',
|
'filter' => 'groupby_numeric',
|
||||||
'sort' => 'groupby_numeric',
|
'sort' => 'groupby_numeric',
|
||||||
],
|
],
|
||||||
|
@ -1850,7 +1844,6 @@ class Sql extends QueryPluginBase {
|
||||||
'method' => 'aggregationMethodSimple',
|
'method' => 'aggregationMethodSimple',
|
||||||
'handler' => [
|
'handler' => [
|
||||||
'argument' => 'groupby_numeric',
|
'argument' => 'groupby_numeric',
|
||||||
'field' => 'numeric',
|
|
||||||
'filter' => 'groupby_numeric',
|
'filter' => 'groupby_numeric',
|
||||||
'sort' => 'groupby_numeric',
|
'sort' => 'groupby_numeric',
|
||||||
],
|
],
|
||||||
|
|
|
@ -25,7 +25,17 @@ class FieldUITest extends UITestBase {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public static $testViews = ['test_view'];
|
public static $testViews = [
|
||||||
|
'test_view',
|
||||||
|
'test_aggregate_count',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected static $modules = [
|
||||||
|
'entity_test',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the UI of field handlers.
|
* Tests the UI of field handlers.
|
||||||
|
@ -104,4 +114,23 @@ class FieldUITest extends UITestBase {
|
||||||
$this->assertEquals('', $view->field['title']->options['label'], 'The field label for normal styles are empty.');
|
$this->assertEquals('', $view->field['title']->options['label'], 'The field label for normal styles are empty.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the UI of field aggregation settings.
|
||||||
|
*/
|
||||||
|
public function testFieldAggregationSettings(): void {
|
||||||
|
$edit_handler_url = 'admin/structure/views/nojs/handler-group/test_aggregate_count/default/field/id';
|
||||||
|
$this->drupalGet($edit_handler_url);
|
||||||
|
$this->submitForm(['options[group_type]' => 'count'], 'Apply');
|
||||||
|
$this->assertSession()
|
||||||
|
->pageTextNotContains('The website encountered an unexpected error. Try again later.');
|
||||||
|
$this->drupalGet($edit_handler_url);
|
||||||
|
$dropdown = $this->getSession()->getPage()->find('named', ['select', 'options[group_column]']);
|
||||||
|
// Ensure the dropdown for group column exists.
|
||||||
|
$this->assertNotNull($dropdown, 'The dropdown for options[group_column] does not exist.');
|
||||||
|
$this->submitForm(['options[group_type]' => 'count'], 'Apply');
|
||||||
|
// Ensure that there is no error after submitting the form.
|
||||||
|
$this->assertSession()
|
||||||
|
->pageTextNotContains('The website encountered an unexpected error. Try again later.');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue