Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Dec 2011 at 21:28 UTC
Updated:
20 Dec 2011 at 20:10 UTC
Jump to comment: Most recent file
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!