When using tokens outside of a render context then this throws an exception.

CommentFileSizeAuthor
#1 token-render-plain-2543756-1.patch1.01 KBberdir

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

Just like all the other render plains, this should collect cacheablity metadata.

dave reid’s picture

So is this needs work then?

berdir’s picture

Not sure, that's not done anywhere else either, we have #2538558: Token cacheablity metadata step 2: Apply the needed cacheability metadata for that.

This broke installation in drush due to pathauto aliases for content being saved there. Missing cacheablity metadata doesn't directly break anything, can just result in incorrect cache variations/invalidations.

I'd just commit this, small steps :)

paulmckibben’s picture

Status: Needs review » Reviewed & tested by the community

I agree with committing it. I applied this patch and have found no issues. Without this patch, we can't use the Token module because it causes some pages to fail.

duaelfr’s picture

+1 RTBC
Please commit, it's locking other changes :)

couturier’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Is there a reason why we cannot commit this patch?

dave reid’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

Reverting unnecessary status change.

damienmckenna’s picture

It seems this will make Metatag easier too :)

  • Berdir committed 91c05a3 on 8.x-1.x
    Issue #2543756 by Berdir: Use renderPlain() in field_tokens()
    
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks for the reviews!

Status: Fixed » Closed (fixed)

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