I haven't figured out why yet, but when view::_init_handler() is called from an ajax views request, views_plugin_display::get_handlers() has some of the handler types set to NULL.
When just using regular calls to views, only the handlers that exist are in the array.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 1360336.patch | 815 bytes | dawehner |
| #1 | views-1360336-1.patch | 570 bytes | tim.plunkett |
Comments
Comment #1
tim.plunkettI'm going out on a limb and calling this major, because it completely defies (my) expectations, and causes huge problems for fullcalendar.
The easy fix is just empty instead of !isset.
Comment #2
tim.plunkettComment #3
merlinofchaos commentedHmm. The handlers being NULL sounds like it may be a deeper problem.
Comment #4
tim.plunkettHow did I know that you would say that? :)
Comment #5
tim.plunkettThis line right here kinda makes me think that empty() would be a better choice.
Comment #6
tim.plunkettIt looks like views_ajax is calling $view->validate() before preview, which initializes the handlers before hook_views_pre_view is called.
This might just be a duplicate of #837816: $view->add_item() doesn#t work in hook_views_pre_build(&$view) with Ajax, except that issue is about pre_build, while this is pre_view, and should have a better chance of working.
Comment #7
dawehnerGood observation!
Personal i believe that $view->validate() should only be called in the ui.
Maybe this is a relict of using view->preview() as direct callback for the ajax in the ui.
Noways views_ui_preview already catches validations so there is no need to do it in view->preview().
Additional running through all validations could cause quite some overhead. So here is my suggestion: remove it.
Comment #8
tim.plunkettThis actually does remove the only call to $view->validate() that is outside includes/admin.inc and tests/views_view.test.
And furthermore, it fixes my problem! hook_views_pre_view is able to use add_item again!
Comment #9
dawehnerSo committed to 6.x-3.x and 7.x-3.x
Yeah!