Problem/Motivation

I get the following error in a particular view block although draggableviews isn't activated in this view (I didn't add field from draggable views in this view)

Fatal error: Call to undefined method stdClass::access() in /sites/all/modules/views/includes/view.inc on line 766

view->build() /sites/all/modules/draggableviews/draggableviews.module:240

Background

If contextual links are enabled draggableviews adds 'Order View' to them. This is a link from the view block/page to the view page that sets the order.

Proposed resolution

Should there not be a check first in hook _contextual_links_view_alter to see if there is a field for draggable sorting?

Additional Information

I have views 7.x-3.11
+ see also http://drupal.org/node/1413596#comment-5912688

Comments

istryker’s picture

Issue summary: View changes
istryker’s picture

Status: Active » Closed (works as designed)

I look into this issue a little more. I cannot reproduce this error, however:

Draggableviews builds the view so it can determine if the current view display is using draggableviews and links to its order view. If you cannot build the view then its not draggableviews fault. You have other non-draggableviews problem.

Now, this makes me think that building the view is not the best solution. To build a view is not simple. There is probably a simpler way. By a quick glance, view does not add the contextual links the same way.

Maybe we can add them using, template_preproces_views_view(&vars) like Views does.

Closing this issue and opened a new one #2495971: Add contextual links during template_preprocess_views_view

istryker’s picture