Closed (fixed)
Project:
Views modify query
Version:
6.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Aug 2008 at 19:38 UTC
Updated:
23 Sep 2008 at 10:42 UTC
I've been hoping for an option like this for quite a while. thank you very much for making this availabe. However I'm not enough of a Drupal expert to get this working. Could you provide a simple code example (using the find_where_clause function)? so I can get a grip on this?
Comments
Comment #1
Alice Heaton commentedHi,
This is a module for development only, and you really shouldn't be using it unless you know what you are doing.
The only pointer I can give you is :
Once you've managed to write your own code to do what you like, I really advise you put it in your own module rather than use the Views Modify Query filter in a production site. You can use the Views Modify Query module as a squeleton, it's pretty simple.
Good luck !
Comment #2
ivrh commentedWouldn't it be easier to write an example to use (you've spent at least 15 minutes typing this text above and what's point)? You still didn't answer the question asked. You mention everywhere - Don't use this module. What is the point of having it listed in Drupal then?
I am trying to figure out the syntax and what I came up so far is something like this:
global $user;
return $query['where'] = "node.nid IN ('". my_filter_nodes($user->uid) ."')";
where my_filter_nodes() is custom function that returns list of nodes for the current user in format 1,2,3,4 - but I can't find my statement in the mysql query listed in view preview box.
Please advise.
Thank you.
Comment #3
ivrh commentedforgot to make active
Comment #4
Alice Heaton commentedThe point is to enable developers who already understand how the views module work to do some quick testing/hacks without having to write a whole module to do that. It is not there to help non-developers tweak their query.
The module description clearly states :
I've removed this module from the listing of modules under 'Views' ; it's only under 'Developer' now so hopefully there will be less likelyhood of people getting confused in the future.
I'm sorry you're feeling frustrated about this, but I can't help you. Everything is said on the module page :
So to understand what you need to do, you need to understand how the views_handler_filter works. The views_handler_filter is an object that is part of the Views module ; so to understand that you need to look at the Views API documentation (which may or may not be complete at this time) or directly at the Views module.
Good luck :)
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.