Download & Extend

Add argument to view info in contextual links (patch included)

Project:Views
Version:7.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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..?

AttachmentSizeStatusTest resultOperations
adds-args-to-views_contextual_links_info.patch405 bytesIgnored: Check issue status.NoneNone

Comments

#1

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.

#2

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
1424762.patch552 bytesIgnored: Check issue status.NoneNone

#3

Status:needs review» reviewed & tested by the community

This looks fine.

#4

Status:reviewed & tested by the community» fixed

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

#5

Status:fixed» closed (fixed)

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

nobody click here