I want to create a taxonomy view which shows the term name and the term image. For those terms without term image, i want to filter out them. Unfortunately there is no term image filter in the view setting. One work around is overriding the view query by implementing the hook_views_pre_execute(&$view) in a custom module. Before you construct the new SQL, you should set all your desire settings in the view editing page first. Then you can create a new SQL base on that view query.
So in the custom module, add the following function. Continue reading Drupal – Customize the Views Query