Hi,

I have a block with a VBO listing garages.
When viewing nodes of type cars, the block is displayed.
I want to link with entity references, the garages and the cars.

I managed to create a rule triggered by the VBO that does exactly that but with 1 major issue: the nid of the car must be typed in by the user as a parameter of the rule component.

My question is then: how can I retreive this node without asking the user to enter the nid?

Thanks for the help.

Comments

Balbo’s picture

Component: Provided Module Integrations » Rules Core

How to do that? Any hint?

Chipie’s picture

Have you found a solution?

CmKeen’s picture

No, not really.
I found a way using PHP but not directly with rules.

Chipie’s picture

How did you do it?

CmKeen’s picture

6 month later and I don't remember how I did it in the first place.
I should certainly have documented here.

Anyone knows how to do it?

CmKeen’s picture

Title: Get current node in Rule Component » Removing a node from a entity reference field with VBO
Version: 7.x-2.1 » 7.x-2.2

Here is the use case.
I have 2 content types called list and restaurant
A list has an multiple entity reference field referencing restaurants

On the list node, I display a views block which is a VBO listing all the restaurants of the list.
When I select some restaurants, I want the VBO to trigger a rule which will remove the selected restaurants from the list.

My issue is that I don't manage to pass the list I'm currently viewing to the rules component.

I tried a bit with php evaluation by looking at the path and returning arg(1) but the path is the one from the batch and not the node/XXX path.

I'm stuck. Any idea is welcome

Slacker’s picture

I have very similar problem, any solution?