I wanted to add a "order view" contextual link and my view takes nid as contextual filter and depending on the nid contextual filter different order should be used.

Since all the info about the view you have available(that I have found) when adding your own contextual link is stored in $element['#element']['#views_contextual_links_info'] (in hook_contextual_links_view_alter) I came to the conclusion that the arguments have to be added here. My order view link is useless without the arguments..

Porhaps you could argue that the whole $view object should be added to make it available when creating contextual links relating to the view..?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Needs review » Needs work

Yes adding the full view object is probably the way to go as it's much more consistent with other views hooks.

amateescu’s picture

Status: Needs work » Needs review
FileSize
552 bytes

Here's a patch that provides the full view object.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

This looks fine.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for providing the patch, just committed it to 7.x-3.x

Status: Fixed » Closed (fixed)

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