Hello
I tried to embed a views by code with contextual links. It does not work with views_embed_view, so i used view_get_view() and then use views_add_contextual_links on my renderable array, setting "$location" to 'view" .

On my site, views_add_contextual_links(&$render_element, $location, $view, $display_id) does not work if $location is set to "view", because of this line ( see attached patch)

$plugin += array('contextual links locations' => array('view'));

as the key 'contextual links locations" is already defined in "$plugin" at this moment, arrays union does not add 'view' value.

CommentFileSizeAuthor
contextual_links_locations.diff777 bytesnyl_auster
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Needs review » Needs work

This is at least from my perspective by design see

     // If contextual links locations are not set, provide a sane default. (To
     // avoid displaying any contextual links at all, a display plugin can still
     // set 'contextual links locations' to, e.g., an empty array.)

You probably should choose another kind of display if you want to have the contextual link.

There is another really recent issue which will allow you to configure this all the time so ...

dawehner’s picture

Issue summary: View changes

precisions on php error.