Support term names containing spaces and dashes

Created on 5 November 2019, about 5 years ago
Updated 16 March 2023, almost 2 years ago

Given the following code:

    if ($this->options['transform']) {
      $argument = str_replace('-', ' ', $argument);
    }

A term with the name: "Product Type-Omega" will fail because it will try to query for terms named "Product Type Omega".

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland dan2k3k4 Zurich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States j_s

    FYI patch #14 doesn't seem to apply anymore on 8.x-1.0-rc1.

  • Status changed to Needs work almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Indeed, it does not. πŸ˜‰

  • πŸ‡ΊπŸ‡ΈUnited States mihaic

    Hi here is an updated version of the patch to works with the latest version of the module 1.0.0-rc1

  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Cool, thanks!

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States dww
    +++ b/src/Plugin/views/argument_validator/TermNameAsId.php
    @@ -1,4 +1,4 @@
    -<?php
    +x`x<?php
    

    Whoops. Need to revert this hunk.

  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Let's see how this goes.

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States dww

    So I think we're just down to this un-addressed feedback of mine from #10:

    I'm not totally thrilled about changing the view to always test with transform enabled. I wonder about only toggling that setting once we start testing that functionality. Or perhaps doing all the tests twice, with and without transform enabled?

  • πŸ‡ΊπŸ‡ΈUnited States mihaic

    Thanks dww sorry about the typo

  • πŸ‡ΊπŸ‡ΈUnited States mihaic

    Hi in Drupal 10 access checking must be explicitly specified on content entity queries as per https://www.drupal.org/node/3201242 β†’ .

    Here is a small update on the latest patch to add access checking and make this code Drupal 10 compatible.

    + $terms_ids = $query->accessCheck(FALSE)->execute();

    Thanks

  • πŸ‡§πŸ‡ͺBelgium ludo.r Brussels

    #27 works for me on Drupal 9.4

  • πŸ‡²πŸ‡ΎMalaysia ckng

    Expanded the patch to cover other special characters: "&", "+", ";", ",". Since some of these are usually used with extra spaces e.g. "First & Second", "First; Second", "First+Second", are supported.

Production build 0.71.5 2024