The field for the facet URL name says ' A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores. '

Is there a reason this can't have hyphens, since other Drupal URLs and Views filter query parameter can contain them?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

borisson_’s picture

Oh no, that makes sense.

StryKaizer’s picture

Status: Active » Needs review

I used the same pattern as views uses for exposed filters now (Only letters, digits and the dot ("."), hyphen ("-"), underscore ("_"), and tilde ("~")),

Tests will prolly be red, still need to fix tests and maybe add some more coverage to ensure the new characters work fine.

StryKaizer’s picture

borisson_’s picture

FileSize
1.38 KB
3.01 KB

I added a test, this test proves that ^ is allowed in the url, I don't think that's right?

Status: Needs review » Needs work

The last submitted patch, 5: allow_hyphens_in_facet-2723365-5.patch, failed testing.

The last submitted patch, 5: allow_hyphens_in_facet-2723365-5.patch, failed testing.

StryKaizer’s picture

Prolly not, looks like you found a bug in views ;)
c/p regex from views

Lets create an issue for this in views, and follow their implementation, as exposed filters' Filter identifier is almost the same as our url_alias

StryKaizer’s picture

jhedstrom’s picture

I posted a patch to #2731333: Filter identifier in exposed filters allow more characters than description states. The core views exposed filter identifier was only tested with a space, and there was a typo in the regex.

StryKaizer’s picture

Status: Needs work » Needs review
FileSize
647 bytes
3.01 KB
borisson_’s picture

Status: Needs review » Fixed

Test agrees, thanks.

borisson_’s picture

  • borisson_ committed ed77bcd on 8.x-1.x authored by StryKaizer
    Issue #2723365 by StryKaizer, borisson_: allow hyphens in facet URLs?
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.