Programmatically modifying global custom text field in view I have a (Apache solr) view with a Global: Custom text field in addition to my normal fields. This field is meant to get value from a custom function/existing field/passing an existing field to a custom function and using return value in one of my modules per each result and I am trying to accomplish this functionality without using Views PHP module.

I referred this very similar query and tried the following approach which did not yield me the result:

hook_views_pre_render:

function mymod_views_pre_render(&amp;$view) {
  if ($view-&gt;name == 'mymodview' &amp;&amp; $view-&gt;current_display == 'mymod_display') {
    $result = &amp;$view-&gt;result;
    foreach ($result as $num_idx =&gt; $result_obj) {
      $result[$num_idx]-&gt;nothing = $result_obj-&gt;an_already_available_field_or_fxn_call;
    }
  }
}


Also tried the same code with hook_views_post_execute to no avail. Using $view-&gt;field['nothing']-&gt;options['alter']['text'] = 'My custom text'; set the default text value to all fields which was not my desired result.

Based on the post linked earlier tried the following code in my theme's template.php

template_preprocess_views_view_fields:

function mytheme_preprocess_views_view_fields(&amp;$vars) {
  $view = $vars['view'];
  if ($view-&gt;name != 'mymodview' &amp;&amp; $view-&gt;current_display != 'mymod_display') {
    return;
  }
  foreach ($view-&gt;field as $id =&gt; $field) {
    $vars['fields']['nothing']-&gt;content = 'Some global custom text content';
  }
}


I am unable to determine what I am missing out on owing to my relative inexperience with views functionality and guidance on achieving this programatically would be much appreciated.
have you tried to use a custom handler? This way you don't need to override nothing.

Related to: Move php in views to module