After installing Nodequeue Extras, when I create a new view that doesn't have a page or block and click "Continue and edit", when the Views editor page loads with the unsaved view it gives the following AJAX error:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /admin/structure/views/view/asdfasdf/preview/default/ajax
StatusText: OK
ResponseText:
( ! ) Fatal error: Call to a member function build() on a non-object in /sites/all/modules/contrib/nodequeue_extras/nodequeue_extras.module on line 10
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | nodequeue_extras-n1619392-6.patch | 610 bytes | jweowu |
| #6 | nodequeue_extras-n1619392-6a.patch | 682 bytes | jweowu |
| #5 | nodequeue_extras-n1619392-5.patch | 4.46 KB | jweowu |
| #4 | nodequeue_extras-n1619392-4.patch | 4.61 KB | jpstrikesback |
| #3 | nodequeue_extras-n1619392-3.patch | 4.49 KB | damienmckenna |
Comments
Comment #1
damienmckennaFYI the error only happens if both the Page and Block options are unchecked on the Create View page.
Comment #2
damienmckennaThis verifies that the $view object isn't empty before trying to load the display, which resolves the error.
Comment #3
damienmckennaAdded a comment.
Comment #4
jpstrikesback commentedFixed a whitespace error and updated paths as it wouldn't apply (for me), otherwise this fixes the build error, thanks!
Comment #5
jweowu commentedRe-rolling #4 against nodequeue_extras git repository.
Comment #6
jweowu commentedI've inverted the new condition in order to reduce the level of nesting (and consequently make the patch much simpler).
FWIW, I think the whole function would probably benefit from being refactored in this way -- instead of introducing so many levels of nesting, invert the test conditions and
returnorcontinuewhen they succeed, and then let the rest of the code carry on at the original nesting level.I'm attaching two patches. The first version applies to the current HEAD; the second version applies after the coding standards patch from http://drupal.org/node/1619400#comment-6427070
Comment #7
jweowu commentedI've posted a new patch at #1920700: Refactor nodequeue_extras_contextual_links_view_alter() which incorporates this one.
Comment #8
azinck commentedMerged to 1.x-dev. Thanks!