hi folks,

at the line 30 you are trying to get the actual entity that is currently viewed, in order to get the correct tokens. you only look at the function 'field_attach_view'.

but also the function 'field_default_view' gets called sometimes (at least when displaying a nodes field in a view)

so i propose the following patch.

please test, it works as i intended in my project, but i did not realy test it heavily, though.

Comments

dave reid’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs review » Fixed

Interesting. It's actually better to change our checking for field_attach_view() to check for field_default_view() since that function is called for both field_attach_view() and field_view_field(), the latter of which is what Views uses sometimes.

I made this change to http://drupalcode.org/project/token_filter.git/commit/7c136e4 for 7.x-1.x-dev.

Status: Fixed » Closed (fixed)

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

jacobroufa’s picture

Beautiful, thanks for this fix!

sylus’s picture

Issue summary: View changes
StatusFileSize
new3.08 KB

Just attaching a patch as no release and want to patch on top of official. Patch above isn't relevant to module root.