change field value in a view using preprocess_views_view_fields I'm trying to change the value of a field in a view programatically but i find some problems. 


first is  that even though I created a Global: custom text field which field id is 'nothing', It's value remain unchanged and the value is applied to a new field created at the end of the view. 
Second is that this function creates some errors and drupal send lots of notices:



  Notice: Undefined property: stdClass::$wrapper_prefix in include()
  (line 32 of
  /my/path/sites/all/modules/views/theme/views-view-fields.tpl.php).
  
  Notice: Undefined property: stdClass::$label_html in include() (line
  33 of
  /my/path/sites/all/modules/views/theme/views-view-fields.tpl.php).
  
  Notice: Undefined property: stdClass::$wrapper_suffix in include()
  (line 35 of
  /my/path/sites/all/modules/views/theme/views-view-fields.tpl.php).


My code is: 

function real_estast_sub_preprocess_views_view_fields(&amp;$vars) {
  $view = $vars['view'];

  foreach ($view-&gt;field as $id =&gt; $field) {

    // change the global custom text content depend on result (node id)
    if ($vars['row']-&gt;nid == 1625){
      $vars['fields']['nothing']-&gt;content = '666€';
    }else{
      $vars['fields']['nothing']-&gt;content = $vars['row']-&gt;field_data_field_price_field_price_value."€/noche ";
    }
  }
}


What's the problem here? I tried to follow all the steps explained in:

How to insert values into Global custom text field of views programmatically?


  Edit:   I soolved the notices form drupal by adding:

  $vars['fields']['nothing']-&gt;wrapper_prefix = '';
  $vars['fields']['nothing']-&gt;wrapper_suffix  = '';
  $vars['fields']['nothing']-&gt;label_html = '';

  
  But it's like I'm defining a totally new field instead of assigning a
  value to the existing one
You are probably not accessing the fields array correctly, and creating your own additional renderable array within $vars.

Install the Devel module if you haven't already and put 

dpm($vars);


at the top of your function.  That will allow you to view the structure of the object on the screen (make sure you're logged in as user 1).