Field not shown in views_get_view()
timmillwood - July 16, 2009 - 13:48
| Project: | Views Custom Field |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
When running the code...
<pre>
<?php
$view = views_get_view(allposts);
$view->execute();
print_r($view->result);
?>
</pre>The result from the views custom field is not shown.

#1
Apparently this issue is also causing the problem in this issue: #573390: Custom text values don't work
Any update on this?
#2
Instead of calling
$view->execute(), call$view->render(). The$view->resultarray should be updated then. The problem is that Views does not have a post-execute hook where VCF would be able to compute the field values. Hence, this computation can only occur at pre-render time.Note that this technique currently works only for the PHP Custom Field. If you report that it works well, I can extend it to Markup and Rownumber.