Hi,

I am wondering why it is that module does not make use of the argument that (a view object) that gets passed to functions implementing hook_views_query_substitutions()?

right now it looks like this:

/**
 * Implements hook_views_query_substitutions().
 */
function argfilters_views_query_substitutions() {
  // TODO: Chache this thing, so we don't have reload the view if it is already
  // loaded. Alternatively, make sure that Views does this alreday (which is
  // likely).
  $view = views_get_current_view();

  // Build the array of replacement patterns, but only if there is any arguments
  // set.
  $replacements = array();

when this will work as well:

/**
 * Implements hook_views_query_substitutions().
 */
function argfilters_views_query_substitutions($view) {
  // Build the array of replacement patterns, but only if there is any arguments
  // set.
  $replacements = array();

Is there anything that I am missing or is the reason for this related to caching?

Comments

itangalo’s picture

Hi – thanks for the question, and sorry that it took so long to get back.

There is no great explanation of why the code looks the way it does – other than this was one of the first modules I wrote.

I am no longer visiting drupal.org every day, or every week, and cannot maintain this project in a good way. :-(
(If you are interested in maintaining this module, please write a comment here and send me a message on my contact page.)

geek-merlin’s picture

Yes i'm interested to maintain and extend this.

geek-merlin’s picture

Title: Argument in hook_views_query_substitutions ignored - why? » Use $view argument in hook_views_query_substitutions
Category: support » task
ar-jan’s picture

Issue summary: View changes

I'll just add that this module is very useful, so it would be great to have more people working on it.

geek-merlin’s picture

@ar-jan: i'm working on a rewrite-on-steroids, just wait a bit... ;-)