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.
Views for Drupal 7 supported taxonomy vocabulary as a contextual filter for terms, but Drupal 8 doesn't seem to. However, it does support taxonomy vocabulary as a regular filter.
The first attached screenshot is from a Drupal 7 views contextual filter interface, the second is that of Drupal 8, and the third is the regular filter for Drupal 8.
Comment | File | Size | Author |
---|---|---|---|
#32 | 2048733-32.patch | 7.84 KB | Lendude |
#24 | Patch failed.PNG | 42.12 KB | swati_qa |
#23 | 2048733-23.patch | 7.87 KB | Lendude |
#21 | Patch gives error.PNG | 35.62 KB | swati_qa |
#18 | 2048733-18.patch | 7.86 KB | Lendude |
Comments
Comment #0.0
bbinkovitz CreditAttribution: bbinkovitz commentedUpdated issue summary.
Comment #0.1
bbinkovitz CreditAttribution: bbinkovitz commentedUpdated issue summary.
Comment #0.2
bbinkovitz CreditAttribution: bbinkovitz commentedUpdated issue summary.
Comment #0.3
bbinkovitz CreditAttribution: bbinkovitz commentedUpdated issue summary.
Comment #1
dawehnerAdding tag. These aren't available anymore, probably due to the conversion of vocabularies to configuration entities, though
these regressions potentially should be marked as a bug.
Thank you for reporting the issue. This is really valuable information given the fact that not many actually use views already in D8.
Comment #1.0
dawehnerUpdated issue summary.
Comment #2
Upchuk CreditAttribution: Upchuk commentedIs this going to get some attention?
Is the views argument plugin VocabularyVid used for anything then?
Comment #3
stBorchertThe attached patch simply "enables" the vocabulary contextual filter and adds a test.
Comment #4
LendudeWhy the markup? Without the markup you can just assertText, seems more straight forward to me.
The rest looks good to go.
Comment #5
stBorchertThe test is basically copied (and slightly adjusted) from
TaxonomyDefaultArgumentTest
andTaxonomyTermArgumentDepthTest
so I simply used, whats already in core :).Comment #6
LendudeHeh, yeah, doesn't make a lot of sense there either, but good enough reason for me :)
Manually tested this and fixes the issue and adds more test coverage, great!
Comment #7
queenvictoria CreditAttribution: queenvictoria at Holly commentedWorks for me too. Thanks!
Comment #8
catchPatch needs a re-roll for 8.1.x.
Comment #9
kostyashupenkoRe-rolled patch from https://www.drupal.org/node/2048733#comment-10783780 for 8.1.x
Comment #11
LendudePutting it on the right branch
Comment #13
LendudeThe reroll isn't quite right.
This shouldn't be removed.
This unset should not be done.
Comment #14
kostyashupenkoRe-rolled patch https://www.drupal.org/node/2048733#comment-10783780 accordance with https://www.drupal.org/node/2048733#comment-10841162
Comment #15
LendudeThanks for the rerolls @kostyashupenko!
one last nitpick: extra newline isn't needed.
Comment #16
Ankit Agrawal CreditAttribution: Ankit Agrawal as a volunteer commentedRe-rolled patch https://www.drupal.org/node/2048733#comment-10841536
in accordance with https://www.drupal.org/node/2048733#comment-10841736
Comment #17
Ankit Agrawal CreditAttribution: Ankit Agrawal as a volunteer commentedComment #18
LendudeWent through this again, but still felt it could use a bit of a clean up. So here is the cleaned up version of the patch, and the test-only version.
Comment #20
swati_qa CreditAttribution: swati_qa commentedThe last patch 2048733-18.patch does not apply, it gives error.
Comment #21
swati_qa CreditAttribution: swati_qa commentedComment #23
Lendudererolled
Comment #24
swati_qa CreditAttribution: swati_qa commentedThe last submitted patch 23: 2048733-23.patch, failed to apply
Comment #25
swati_qa CreditAttribution: swati_qa commentedComment #26
swati_qa CreditAttribution: swati_qa commentedComment #27
Lendude@swati_qa You tried to apply it to 8.0.x, not 8.1.x. The patch in #23 is for 8.1.x
Comment #32
Lendudereroll.
related issue for fields #2658956: Taxonomy vocabulary data not available as views fields
Comment #33
merauluka CreditAttribution: merauluka commentedI just applied #32 to my 8.1.9 site and it worked perfectly.
Thanks!
Comment #34
dawehnerThis is a really clear test, thank you!
Comment #35
alexpottCommitted 1e95bd7 and pushed to 8.3.x. Thanks!
Only added to 8.3.x as nothing is broken per-se - this is just enabling something that was available in Drupal 7 views.
Removed this on commit since it is no longer the coding standard.
Comment #38
jayemel CreditAttribution: jayemel commentedIs this going to make it in to a release? As of 8.8.4 there is no option for a Vocabulary contextual filter.
Comment #39
bserem CreditAttribution: bserem at zehnplus commented@jmljuniort ss far as I can tell you need to add a term relationship to get the vocabulery contextual filter in a content view.