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

Comments

damienmckenna’s picture

FYI the error only happens if both the Page and Block options are unchecked on the Create View page.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new4.38 KB

This verifies that the $view object isn't empty before trying to load the display, which resolves the error.

damienmckenna’s picture

StatusFileSize
new4.49 KB

Added a comment.

jpstrikesback’s picture

StatusFileSize
new4.61 KB

Fixed a whitespace error and updated paths as it wouldn't apply (for me), otherwise this fixes the build error, thanks!

jweowu’s picture

StatusFileSize
new4.46 KB

Re-rolling #4 against nodequeue_extras git repository.

jweowu’s picture

I'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 return or continue when 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

jweowu’s picture

I've posted a new patch at #1920700: Refactor nodequeue_extras_contextual_links_view_alter() which incorporates this one.

azinck’s picture

Issue summary: View changes
Status: Needs review » Fixed

Merged to 1.x-dev. Thanks!

  • c0dbb99 committed on 7.x-1.x
    Issues #1920700 and #1619392 by DamienMcKenna, jpstrikesback, jweowu:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.