Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#31 | drupal-1809128-31.patch | 13.39 KB | dawehner |
#29 | interdiff.txt | 2.37 KB | dawehner |
#28 | drupal-1809128-28.patch | 13.44 KB | dawehner |
#27 | views-1748176-27_1.patch | 9.28 KB | h4rrydog |
#25 | views-1748176-27.patch | 1.45 KB | h4rrydog |
Comments
Comment #1
dawehnerLet's role a patch against 8.x-3.x
Comment #2
aspilicious CreditAttribution: aspilicious commenteddon't hate me
Comment #3
damiankloip CreditAttribution: damiankloip commentedThe fix looks fine, but agree we probably need tests :)
Comment #4
dawehnerComment #5
xjmComment #6
fastangel CreditAttribution: fastangel commentedRerolled.
Comment #7
fastangel CreditAttribution: fastangel commentedI 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.
Comment #8
dawehnerNow 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.
Comment #9
fastangel CreditAttribution: fastangel commentedI attach a new patch. This patch contain the test for see if work fine the aggregation.
Comment #11
fastangel CreditAttribution: fastangel commentedSorry. The new patch
Comment #12
dawehnerGreat work!
There are just some small things.
Should have a point at the end.
Better remove all this debug calls first :)
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".
We decided to remove the uuid from test views, sure you can't know that. Please remove UUID from all of the test views.
Comment #13
fastangel CreditAttribution: fastangel commentedI attach new patch with all changes.
Comment #14
dawehnerThanks for all your hard work!
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.
Comment #15
fastangel CreditAttribution: fastangel commenteddawehner thanks for the information. I attach a new patch.
Comment #16
dawehnerIt is getting near!
You should probably use the same code as below for the disabling of the link.
For easier code readability an empty line here would help.
You just don't need this anymore. Maybe move the "Disable the link" comment above
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
Comment #17
fastangel CreditAttribution: fastangel commentedOk. New patch with the changes and with other assert for test Result.
Comment #19
fastangel CreditAttribution: fastangel commentedNew 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.
Comment #21
fastangel CreditAttribution: fastangel commentedForgot my last comment. I attach new patch. In my local passed all test.
Comment #22
dawehnerFixed some small nitpicks which aren't worth to let you rerole the patch.
Comment #24
fastangel CreditAttribution: fastangel commented@dawehner you had one error with one . :D
Comment #25
h4rrydog CreditAttribution: h4rrydog commentedRerolled the patch.
Comment #26
dawehner@h4rrydog
You seems to have a lot of parts missing.
Comment #27
h4rrydog CreditAttribution: h4rrydog commentedSorry... my fault. Here's the reroll...
Comment #28
dawehnerEverything from 24 to 27 can be ignored :) It's simply the wrong patch.
Comment #29
dawehnerForgot the interdiff
Comment #30
dawehner#28: drupal-1809128-28.patch queued for re-testing.
Comment #31
dawehnerAnother piece of rerole.
Comment #32
dawehner#31: drupal-1809128-31.patch queued for re-testing.
Comment #34
YesCT CreditAttribution: YesCT commentedComment #41
Pancho