How to alter combined filter value programatically? When taxonomy terms are combined, the values searched are term id instead of term name. So I tried to alter the query using views_query_alter. But it seems the values are coming from object.

function MYMODULE_views_query_alter(&amp;$view, &amp;$query) {
 if ($view-&gt;name == 'my_view') {
   if (is_object($query-&gt;where[1]['conditions'][0]['field'])) {
     foreach ($query-&gt;where[1]['conditions'][0]['field']-&gt;conditions() as $key =&gt; $value) {
        if (is_numeric($key)) {
          $possible_terms[] = $value['value'][':views_combine'];
        }
      }
     // here i was planning to load the term id from the partial
     // term search key from combined filter
     // once the term is identified, i would like to update the query.
   }
 }
}


The problem is $query-&gt;where[1]['conditions'][0]['field']-&gt;conditions() is a function and I don't know how to substitute value to it.
The example on the hook_views_query_alter page should get you started. Whet they do here is changing the node title into the node id, by redefining the $condition variable. 

function hook_views_query_alter(&amp;$view, &amp;$query) {
  // (Example assuming a view with an exposed filter on node title.)
  // If the input for the title filter is a positive integer, filter against
  // node ID instead of node title.
  if ($view-&gt;name == 'my_view' &amp;&amp; is_numeric($view-&gt;exposed_raw_input['title']) &amp;&amp; $view-&gt;exposed_raw_input['title'] &gt; 0) {
    // Traverse through the 'where' part of the query.
    foreach ($query-&gt;where as &amp;$condition_group) {]

// Run through all conditions and pass them by reference. 
// (Altering the value here will change it for all things later on.)

      foreach ($condition_group['conditions'] as &amp;$condition) {
        // If this is the part of the query filtering on title, chang the
        // condition to filter on node ID.

//If there is a condition on the title field

        if ($condition['field'] == 'node.title') {

// Overwrite the condition 

          $condition = array(
            'field' =&gt; 'node.nid',
            'value' =&gt; $view-&gt;exposed_raw_input['title'],
            'operator' =&gt; '=',
          );
        }
      }
    }
  }
}


You should be able to copy quite a lot of this function, tweak the initial if statement a bit so it does not filter on title, and substitute your own values. 

I have not used a combined filter, but the Views API converts into similar to this. If you add some debug code to find out what the initial array is, you should be able to substitute that.