Problem/Motivation

When using the pathauto module in combination with System tags the generation of paths doesn't work as expected. E.g. when you create a jobs overview page (node) with the following menu structure:

* Careers
** Jobs

When you create a system_tag "jobs" and add an entity_reference field (to system_tag entities) on the jobs page and reference to the "jobs" system tag, the system_tags module will create the token [system-tags][node--jobs]. This token will return the path of the jobs overview page e.g. careers/jobs.

When you use this token to generate paths for a job content type and add use the pattern "[system-tags][node--jobs]/[node:title]". The expected value is "/careers/jobs/vacancy-title". But the value we currently get is /careersjobs/vacancy-title. A possible workaround is to add every last part of the system tag tokens to the safe_tokens. An easier solution for us is to add "system-tags" to the safe_tokens.

Proposed resolution

Allow the safe_token to check the first part of of the token.

Comments

Waldoswndrwrld created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, pathauto_safe_token_regex.patch, failed testing. View results

jeroent’s picture

StatusFileSize
new1.06 KB

Added a test.

jeroent’s picture

Issue summary: View changes
Waldoswndrwrld’s picture

Status: Needs work » Needs review
StatusFileSize
new624 bytes

Make changes so the patch passes the test

jeroent’s picture

Waldoswndrwrld’s picture

StatusFileSize
new1.06 KB

Added the test to the patch.

jeroent’s picture

Status: Needs review » Reviewed & tested by the community

Code is working and tests are passing. Marking as RTBC.

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Took me a moment to to understand this, was confused by the weird syntax of that system tags stuff, not sure if that's an valid example, but makes sense as a change, committed.

  • Berdir committed 5a43634 on 8.x-1.x authored by Waldoswndrwrld
    Issue #3051381 by Waldoswndrwrld, JeroenT: Allow optional regex check on...

Status: Fixed » Closed (fixed)

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