SQL

Jul 02 2010

Overriding a Drupal Views SQL Query

We all know and love Drupal Views. The queries that it builds are most often very elegant, but there are certain cases where you need to use a query that is just a bit too complicated for the Views query generator to build on its own. I ran into this recently where I could not accomplish my task without a join to a sub-query.

If you find this to be the case, you can utilize the views_pre_execute hook to override the query being supplied by Views.

Subscribe to RSS - SQL