From f4950b18c50458fb958ee2f039a809e25c61a838 Mon Sep 17 00:00:00 2001
From: catch <6915-catch@users.noreply.drupalcode.org>
Date: Tue, 15 Apr 2025 00:28:27 +0100
Subject: [PATCH] Issue #2735997 by ramil g, joelpittet, ranjith_kumar_k_u,
 asad_ahmed, nikita_tt, catch, Ben Greenberg, mschudders, lendude, playful:
 Decimal separator and decimals settings ignored when aggregating decimal
 fields (revert)

(cherry picked from commit 08c5d9b749d538de223c4eb4d4abdb6a04bc1565)
---
 .../views/src/Plugin/views/query/Sql.php      |  7 +++++
 .../tests/src/Functional/FieldUITest.php      | 31 +------------------
 2 files changed, 8 insertions(+), 30 deletions(-)

diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index 7b3646bac697..9ca4b8e12799 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -1774,6 +1774,7 @@ public function getAggregationInfo() {
         'method' => 'aggregationMethodSimple',
         'handler' => [
           'argument' => 'groupby_numeric',
+          'field' => 'numeric',
           'filter' => 'groupby_numeric',
           'sort' => 'groupby_numeric',
         ],
@@ -1783,6 +1784,7 @@ public function getAggregationInfo() {
         'method' => 'aggregationMethodDistinct',
         'handler' => [
           'argument' => 'groupby_numeric',
+          'field' => 'numeric',
           'filter' => 'groupby_numeric',
           'sort' => 'groupby_numeric',
         ],
@@ -1792,6 +1794,7 @@ public function getAggregationInfo() {
         'method' => 'aggregationMethodSimple',
         'handler' => [
           'argument' => 'groupby_numeric',
+          'field' => 'numeric',
           'filter' => 'groupby_numeric',
           'sort' => 'groupby_numeric',
         ],
@@ -1801,6 +1804,7 @@ public function getAggregationInfo() {
         'method' => 'aggregationMethodSimple',
         'handler' => [
           'argument' => 'groupby_numeric',
+          'field' => 'numeric',
           'filter' => 'groupby_numeric',
           'sort' => 'groupby_numeric',
         ],
@@ -1810,6 +1814,7 @@ public function getAggregationInfo() {
         'method' => 'aggregationMethodSimple',
         'handler' => [
           'argument' => 'groupby_numeric',
+          'field' => 'numeric',
           'filter' => 'groupby_numeric',
           'sort' => 'groupby_numeric',
         ],
@@ -1819,6 +1824,7 @@ public function getAggregationInfo() {
         'method' => 'aggregationMethodSimple',
         'handler' => [
           'argument' => 'groupby_numeric',
+          'field' => 'numeric',
           'filter' => 'groupby_numeric',
           'sort' => 'groupby_numeric',
         ],
@@ -1828,6 +1834,7 @@ public function getAggregationInfo() {
         'method' => 'aggregationMethodSimple',
         'handler' => [
           'argument' => 'groupby_numeric',
+          'field' => 'numeric',
           'filter' => 'groupby_numeric',
           'sort' => 'groupby_numeric',
         ],
diff --git a/core/modules/views_ui/tests/src/Functional/FieldUITest.php b/core/modules/views_ui/tests/src/Functional/FieldUITest.php
index 2789dfe1556c..cd8a199d18af 100644
--- a/core/modules/views_ui/tests/src/Functional/FieldUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/FieldUITest.php
@@ -25,17 +25,7 @@ class FieldUITest extends UITestBase {
    *
    * @var array
    */
-  public static $testViews = [
-    'test_view',
-    'test_aggregate_count',
-  ];
-
-  /**
-   * {@inheritdoc}
-   */
-  protected static $modules = [
-    'entity_test',
-  ];
+  public static $testViews = ['test_view'];
 
   /**
    * Tests the UI of field handlers.
@@ -114,23 +104,4 @@ public function testFieldLabel(): void {
     $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.');
-  }
-
 }
-- 
GitLab