I have a custom token that gets the path
value from a JSON field. The JSON field stores the path like this (in the database, the slashes are escaped, but I'm showing an unescaped example here):
{ "path": "a/b/c" }
Every node contains this JSON field, so I made a custom token, [mymodule:json_path]
.
I then set this token as the path for nodes on the PathAuto patterns page (/admin/config/search/path/patterns
).
However, PathAuto is stripping the slashes, so when I save a node, I get the path abc
when I want a/b/c
.
Elsewhere, when I use the token, I get the value with unescaped slashes as expected (for example, a/b/c
); I know this because if I set a metatag on the node to the token, the expected value appears.
Also, if I disable Generate automatic URL alias and manually set the path to /a/b/c
, then I get the expected path of /a/b/c
.
So, how can I get PathAuto not to remove the slashes?