How to alter incorrect Join type generated by Views? I am suffering from a bug in Views 7.x-3.11 detailed here in relation to filter groups. Views incorrectly adds INNER JOINs when LEFT joins would be correct.

I am trying to alter the $query object using the code ( this approach is not based on any documentation, but simply a guess ):

function mymodule_views_query_alter(&amp;$view, &amp;$query) {
  if($view-&gt;name == 'my-view' &amp;&amp; $view-&gt;current_display == 'my-display') {
    $query-&gt;table_queue['field_data_field_listing_type']['join']-&gt;type = 'LEFT';
  }
}


However this change causes the View to generate an ajax error "Fatal error: Call to undefined method stdClass::build_join in sites/all/modules/views/plugin/views_plugin_query_default.inc on line 1313".

Any assistance?
Complete operator error.  For the benefit of anyone else who encounters this error check your fieldname.  In my case I had misspelt the fieldname ['field_data_field_listing_type'] so it was generating a new incompleted entry in the table_queue array.