Closed (outdated)
Project:
Drupal core
Version:
11.x-dev
Component:
views.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Feb 2014 at 19:15 UTC
Updated:
10 Jun 2025 at 13:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tim.plunkettThis has been done without an alter since at least 6.x-2.x, but I have no idea why. Maybe @dawehner knows?
Comment #2
sunOopsie, the signature is different... :-/
→ #329012: Remove call_user_func_array() from ModuleHandler::invoke() + invokeAll()
Comment #4
sunI guess the reason is simple: Only D7 added support for alter hooks in themes.
Prior to D7, themes did not participate in drupal_alter().
Comment #5
dawehnerMh, so we have all kind of even more hooks:
All of those are mostly used to change the executed view, so we might should consider to mark all of those as alter hooks?
In general you mostly can alter anything in D8 as we use a lot of objects.
On all these hooks in views I would consider views_pre_render as the one which will add new stuff, like new rows etc.
Still not sure whether we want to keep this functionality to be honest. This causes all kind of dependency problems, as for example the theme system
cannot be loaded lazy due to that.
Comment #6
tim.plunkettAha! That seems like a perfectly logical explanation.
Comment #7
sun@dawehner: Interesting.
For the sake of architectural cleanliness, I think that every hook that primarily exists in order to modify previously built/added data should be an alter hook.
Without having any kind of idea what the listed hooks are doing, here are my assumptions:
Comment #9
dawehnerTo be honest I can not imagine many usecases which don't alter the view, for non of those hooks.
No hook_views_pre_execute is not hook_views_query_alter ... executing a view is way more than altering the query, actually query is kind of the special case as the query will always depend on your actual query backend you use, though the execution is a general idea.
Yes, though there are clear usecases like when you wanna take the result and do something without before it comes to the rendering step.
Comment #23
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #24
smustgrave commentedSince there's been no follow up in 3 months going to close out, but don't worry! This can always be re-opened
Thanks all
Also we have moved to OOP classes