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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3051381-7.patch | 1.06 KB | Waldoswndrwrld |
Comments
Comment #3
jeroentAdded a test.
Comment #4
jeroentComment #5
Waldoswndrwrld commentedMake changes so the patch passes the test
Comment #6
jeroentComment #7
Waldoswndrwrld commentedAdded the test to the patch.
Comment #8
jeroentCode is working and tests are passing. Marking as RTBC.
Comment #9
berdirTook 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.