It would be very useful and great UX improvement to integrate with PHP and REPLACEMENT PATTERNS.

Thanks,

Comments

rogical’s picture

StatusFileSize
new36 KB

dd

grasmash’s picture

+ 1

matt__’s picture

Category: feature » bug

+1

IMO this is a bug, not a feature request.

bloomt’s picture

+1 The person that solves this problem will be getting a virtual high five from this guy.

capellic’s picture

In the meantime, use the field_view_field() function to get the properly rendered field:

http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way

icanko’s picture

Maybe I don't understand the question, but I think you could add some fields that contain the needed tokens and exclude them from display. Then add the php field and use the other fields as variables.

liquidcms’s picture

Issue summary: View changes
StatusFileSize
new2.04 KB

this is exactly right as it gives the non-rewritten field values... but its a start and much more useful than as it is now.

so i can now do this:

$tid =  '[field_primary_division-tid]';
$term = taxonomy_term_load($tid);
echo $term->field_site_acronym['und'][0]['value'];

this is on the -alpha version

liquidcms’s picture

hmm.. no, i think my patch is wrong.. it may only pull token from first row.. ughh

liquidcms’s picture

StatusFileSize
new2.18 KB

but this one works.. :)

liquidcms’s picture

Status: Active » Needs review
StatusFileSize
new2.07 KB

patch above didnt account for tokens sometimes getting processed before the php field is processed.

new patch fixes this and seems pretty solid now..

ikeigenwijs’s picture

Status: Needs review » Needs work

+1 for this functionality!

.patch does not apply on clean install.
The function pre_render can not be found in views_php*
I did not found what to patch to get this working
No classes in views_php*

  1. --- sites/all/modules/views_php
    +++ sites/all/modules/views_php
    

    .module needs to be added otherwise file not found.
    Also I think the standard is to do relative of the module root.

I want to review if you have a new version.

marcopbazz’s picture

#11 the file to patch is views_php_handler_field.inc (in plugins/views).

Patch work only for output, not for value (but this is related to this: https://www.drupal.org/node/1140896)