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..?
Comment | File | Size | Author |
---|---|---|---|
#2 | 1424762.patch | 552 bytes | amateescu |
adds-args-to-views_contextual_links_info.patch | 405 bytes | emattias | |
Comments
Comment #1
dawehnerYes adding the full view object is probably the way to go as it's much more consistent with other views hooks.
Comment #2
amateescu CreditAttribution: amateescu commentedHere's a patch that provides the full view object.
Comment #3
dawehnerThis looks fine.
Comment #4
dawehnerThanks for providing the patch, just committed it to 7.x-3.x