Several field tokens did not show up in the token browser when configuring a pathauto pattern. We wanted to use the first start date of a multi-valued daterange field, custom formatted. The token browser currently went as far as [node:field_when:0:start_date], and I was able to insert this as a token in the token browser, always resulting in an empty value however when this token gets replaced. It took a while for me to figure out that the tokens I needed are actually existing, but simply not shown in the token browser because of the depth/recursion set in TreeBuilder::buildRenderable(). $options['recursion_limit'] is set there to 3, if I change it to 4 the tokens I need suddenly show up, e.g. [node:field_when:0:start_date:custom:?].

Maybe it would be a good idea to mention this limitation somewhere at the top of the token browser, and allow admins to increase the depth/recursion in case it is insufficient while configuring a website. This would hopefully reduce the confusion this might cause currently :)

Comments

Cyberwolf created an issue.

Berdir’s picture

increasing is very problematic because the amount of tokens grows exponentially, especially with reference fields. Many sites even have to use a lower limit.

The only reliable solution is to rewrite the token browser so that it uses lazy-loading to expand the trees.