I have a view which lists nodes referred to by another node, i.e. my view at list/123 shows the nodes referenced by a field on node 123. I'm trying to write an action (actually a rule set) that can remove the selected nodes from the list of references; I can get the nids of the nodes through as a parameter to the action but how can I also get the nid of the parent node? Is there a way to pass that through as a second parameter to the action?

Comments

bojanz’s picture

Status: Active » Fixed

When your action runs, it's still at list/123, so you can fetch the parent nid from there (the url).
Either that, or node_load($nid), then take what you need from the $node object.
EDIT: Actually, you already get the node object. No need to load it.

Status: Fixed » Closed (fixed)

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

wickwood’s picture

Issue summary: View changes
Status: Closed (fixed) » Active
wickwood’s picture

Bojanz, or anyone else, how exactly do you fetch a parameter from the view URL and pass it along as a parameter to the Bulk Operation?

Any help would be great appreciated! Thanks in advance!
Steve

wickwood’s picture

I don't know how it was done here, but I was able to solve my problem with a patch to VBO. You can find it and how I did it at the VBO Issue: Let view arguments be passed as parameters to rule set

wickwood’s picture

Status: Active » Closed (fixed)