I am aggregating the Term names, but its not aggregating correctly.
Why? Finding terms that occur more than one time

The views
http://pastebin.com/VM587Fhq

the sql

SELECT taxonomy_term_data.name AS taxonomy_term_data_name, taxonomy_term_data.vid AS taxonomy_term_data_vid, taxonomy_term_data.tid AS tid, taxonomy_vocabulary.machine_name AS taxonomy_vocabulary_machine_name, COUNT(taxonomy_term_data.name) AS taxonomy_term_data_name_1
FROM 
{taxonomy_term_data} taxonomy_term_data
LEFT JOIN {taxonomy_vocabulary} taxonomy_vocabulary ON taxonomy_term_data.vid = taxonomy_vocabulary.vid
WHERE (( (taxonomy_term_data.vid IN  ('8')) ))
GROUP BY taxonomy_term_data_name, taxonomy_term_data_vid, tid, taxonomy_vocabulary_machine_name
ORDER BY taxonomy_term_data_name_1 ASC
LIMIT 100 OFFSET 0

Title	Taxonomy Translation Filter
Path	ttf
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Version: 7.x-3.5 » 8.x-3.x-dev
Status: Active » Needs review
Issue tags: +VDC
FileSize
2.27 KB

Let's role a patch against 8.x-3.x

aspilicious’s picture

Issue tags: +Needs tests

don't hate me

damiankloip’s picture

Status: Needs review » Needs work

The fix looks fine, but agree we probably need tests :)

dawehner’s picture

Status: Needs work » Needs review
FileSize
3.05 KB
xjm’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: Miscellaneous » views.module
Status: Needs review » Needs work
Issue tags: +Needs reroll
fastangel’s picture

Status: Needs work » Needs review
FileSize
3.16 KB

Rerolled.

fastangel’s picture

I tested this issue. The issue have the solution in the comment #1809128-1: Taxonomy aggregation of name fields and the test in the comment #1809128-4: Taxonomy aggregation of name fields. If I apply the test without solution the test pass fine. If I apply the patch in the comment 1 and create two taxonomy with (vocabulary1: test1, test2, vocabulary2: test1, test2) I get in the result (Agregation 1) and the link to term is correct. This is expected behavior?. Patches makes sense?.

NOTE: The reroll only contains the code from comment #1809128-4: Taxonomy aggregation of name fields (without comment #1809128-1: Taxonomy aggregation of name fields) and pass all tests.

dawehner’s picture

Now i remember, the test itself doesn't fail, because the actual bug is much more complicated.

You would have to create a aggregation query and group by the name field to see see initial report.
Anyway i think the test in #6 would be helpful as it tests the functionality of the handler in general.

fastangel’s picture

FileSize
14.07 KB

I attach a new patch. This patch contain the test for see if work fine the aggregation.

Status: Needs review » Needs work

The last submitted patch, views-1809128-9.patch, failed testing.

fastangel’s picture

Status: Needs work » Needs review
FileSize
16.45 KB

Sorry. The new patch

dawehner’s picture

Status: Needs review » Needs work

Great work!

There are just some small things.

+++ b/core/modules/views/lib/Drupal/views/Tests/Taxonomy/TaxonomyFieldTest.phpundefined
@@ -0,0 +1,96 @@
+    // Disable the link
...
+    //Check that terms[0] and term[1] is aggregated correctly and the count is 2

Should have a point at the end.

+++ b/core/modules/views/lib/Drupal/views/Tests/Taxonomy/TaxonomyFieldTest.phpundefined
@@ -0,0 +1,96 @@
+    debug($output);
...
+    debug($output);
...
+    debug($output);

Better remove all this debug calls first :)

+++ b/core/modules/views/lib/Drupal/views/Tests/Taxonomy/TaxonomyFieldTest.phpundefined
@@ -0,0 +1,96 @@
+    $view = views_get_view('test_taxonomy_field_aggregation_wo_link');

To be able to save some test views you could change the setting (whether it is linked or not), see the code after "Disable the link".

+++ b/core/modules/views/tests/views_test_config/config/views.view.test_taxonomy_field.ymlundefined
@@ -0,0 +1,53 @@
+uuid: 7dca114c-419f-46e1-9405-05415ba4939c

+++ b/core/modules/views/tests/views_test_config/config/views.view.test_taxonomy_field_aggregation.ymlundefined
@@ -0,0 +1,165 @@
+uuid: d2a34445-6850-4bde-9800-da39bf731ce6

+++ b/core/modules/views/tests/views_test_config/config/views.view.test_taxonomy_field_aggregation_wo_link.ymlundefined
@@ -0,0 +1,165 @@
+uuid: d2a34445-6850-4bde-9811-da39bf632ce6

We decided to remove the uuid from test views, sure you can't know that. Please remove UUID from all of the test views.

fastangel’s picture

Status: Needs work » Needs review
FileSize
11.8 KB

I attach new patch with all changes.

dawehner’s picture

Thanks for all your hard work!

$view->field['name']->additional_fields = array();

Oh i see the init method does actually set the additional_fields.

As this issue is actually about the behavior of the init() method we should not just override it's values but set the option before. One way to do this would be to use $view->storage->display['default']['display_options']['fields']['name']['link_to_taxonomy'] = FALSE; and then call $view->initHandlers();

I guess it would be helpful to explain that in a short comment.

fastangel’s picture

FileSize
11.85 KB

dawehner thanks for the information. I attach a new patch.

dawehner’s picture

Status: Needs review » Needs work

It is getting near!

+++ b/core/modules/views/lib/Drupal/views/Tests/Taxonomy/TaxonomyFieldTest.phpundefined
@@ -0,0 +1,97 @@
+    $view->field['name']->options['link_to_taxonomy'] = FALSE;

You should probably use the same code as below for the disabling of the link.

+++ b/core/modules/views/lib/Drupal/views/Tests/Taxonomy/TaxonomyFieldTest.phpundefined
@@ -0,0 +1,97 @@
+    $view->storage->display['default']['display_options']['fields']['name']['link_to_taxonomy'] = FALSE;

For easier code readability an empty line here would help.

+++ b/core/modules/views/lib/Drupal/views/Tests/Taxonomy/TaxonomyFieldTest.phpundefined
@@ -0,0 +1,97 @@
+    $view->field['name']->options['link_to_taxonomy'] = FALSE;

You just don't need this anymore. Maybe move the "Disable the link" comment above

+++ b/core/modules/views/lib/Drupal/views/Tests/Taxonomy/TaxonomyFieldTest.phpundefined
@@ -0,0 +1,97 @@
+    $this->assertTrue(strpos($output, '<span class="field-content">2</span>') !== FALSE, "The field name with aggregation work fine"); ¶

Just a space at the end. Additional you could improve the assertion message with "Check that the terms are aggregated correctly". Maybe you could also test the actual query result of the view. There is also a helper method for that $this->assertIdenticalResultSet

fastangel’s picture

Status: Needs work » Needs review
FileSize
12.17 KB

Ok. New patch with the changes and with other assert for test Result.

Status: Needs review » Needs work

The last submitted patch, views-1809128-17.patch, failed testing.

fastangel’s picture

Status: Needs work » Needs review
FileSize
12.46 KB

New patch with problem fixed. Another thing I've noticed. If I add a sort by name or by tid is replayed the same error. Is this behavior correct?

Regrads.

Status: Needs review » Needs work

The last submitted patch, views-1809128-19.patch, failed testing.

fastangel’s picture

Status: Needs work » Needs review
FileSize
12.55 KB

Forgot my last comment. I attach new patch. In my local passed all test.

dawehner’s picture

FileSize
3 KB
12.66 KB

Fixed some small nitpicks which aren't worth to let you rerole the patch.

Status: Needs review » Needs work

The last submitted patch, core-1809128-22.patch, failed testing.

fastangel’s picture

Status: Needs work » Needs review
FileSize
11.04 KB

@dawehner you had one error with one . :D

h4rrydog’s picture

FileSize
1.45 KB

Rerolled the patch.

dawehner’s picture

@h4rrydog
You seems to have a lot of parts missing.

h4rrydog’s picture

FileSize
9.28 KB

Sorry... my fault. Here's the reroll...

dawehner’s picture

FileSize
13.44 KB

Everything from 24 to 27 can be ignored :) It's simply the wrong patch.

dawehner’s picture

Issue tags: -Needs tests, -Needs reroll
FileSize
2.37 KB

Forgot the interdiff

dawehner’s picture

#28: drupal-1809128-28.patch queued for re-testing.

dawehner’s picture

FileSize
13.39 KB

Another piece of rerole.

dawehner’s picture

Issue tags: -VDC

#31: drupal-1809128-31.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, drupal-1809128-31.patch, failed testing.

YesCT’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Pancho’s picture

Issue tags: +views aggregation

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.