function views_query_views_alter

cis7 views.module views_query_views_alter(QueryAlterableInterface $query)
cle7 views.module views_query_views_alter(QueryAlterableInterface $query)
elmsmedia7 views.module views_query_views_alter(QueryAlterableInterface $query)
icor7 views.module views_query_views_alter(QueryAlterableInterface $query)
meedjum_blog7 views.module views_query_views_alter(QueryAlterableInterface $query)
mooc7 views.module views_query_views_alter(QueryAlterableInterface $query)

Implements hook_query_TAG_alter().

This is the hook_query_alter() for queries tagged by Views and is used to add in substitutions from hook_views_query_substitutions().

1 call to views_query_views_alter()
_views_query_tag_alter_condition in sites/all/modules/ulmus/views/views.module
Replaces the substitutions recursive foreach condition.

File

sites/all/modules/ulmus/views/views.module, line 2126
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_query_views_alter(QueryAlterableInterface $query) {
  $substitutions = $query->getMetaData('views_substitutions');
  $tables = &$query->getTables();
  $where = &$query->conditions();

  // Replaces substitions in tables.
  foreach ($tables as $table_name => $table_metadata) {
    foreach ($table_metadata['arguments'] as $replacement_key => $value) {
      if (isset($substitutions[$value])) {
        $tables[$table_name]['arguments'][$replacement_key] = $substitutions[$value];
      }
    }
  }

  // Replaces substitions in filter criterias.
  _views_query_tag_alter_condition($query, $where, $substitutions);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.