Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
6.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
19 Jul 2010 at 08:58 UTC
Updated:
26 Jul 2017 at 10:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerThe same for views_date_sql_extract and views_date_sql_format
Comment #2
miro_dietikerLooks straightforward to me and makes the backend more pluggable.
Comment #3
dawehnerDo the same for views_get_timezone
Perhaps this functions could be removed and the query backend could directly call $this->$function
Comment #4
merlinofchaos commentedRecent commits cause this to not apply. Whoops.
That said, I'm in favor of this; please make sure we do some actual testing of it to make sure existing date stuff does not break?
Comment #5
dawehnerRerole
#needs more testing
Comment #6
miro_dietikerlooks (visually) fine to me. no application and coderun tested.
Comment #7
merlinofchaos commentedWhat's the possibility of these functions being called without a view?
Well, in Views itself, the answer is 'never'. Obviously we can't know what people outside Views are doing. But we should probably have a fallback condition for that case.
Additionally, a quick grep shows that everywhere Views calls any of these functions, we have a view already. We should shortcut things and call directly to $view->query->$function so we don't have to go through the global wrapper function.
We can then mark the global wrapper function as @deprecated, and just remove it in D7 and require all contrib modules to use the new functions.
Comment #8
dawehnerWe could call the method statically.
Comment #9
mustanggb commented