Closed (fixed)
Project:
Views Bulk Operations (VBO)
Version:
7.x-3.x-dev
Component:
Core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 May 2011 at 13:56 UTC
Updated:
11 Jul 2011 at 10:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
bojanz commentedOf course, we can't entity_load() everything, but there might be a trick that could allow us to have the tokens available. Will see with fago.
Comment #2
fagooh, that works only if you have an action set... e.g.
where VAR is the name of the parameter that needs the entity..
If you need to get the action from inside the set it works that way:
Comment #3
fagoRealized the example doesn't fit the use-case as we only want to embed the action form, not the form of the whole action-set.
E.g. that way
Comment #4
bojanz commentedHere's a first patch.
It shows all tokens as it should but the form can't be submitted, it fails validation complaining that $test is not present (the entity param of the component I'm executing, and whose form I'm nuking with unset since I'm passing it to ->execute() later on).
Comment #5
fagoYou'll need to fix the var-names of my example.. ;)
See my attached patch. I've no time to test it right now, but basically I think it should work like that.
Comment #6
wjaspers commentedsubbing
Comment #7
bojanz commentedYes, it works without that line now. However, back in may when that was written, I was getting fatal errors without it. Maybe an issue was fixed in the meantime?
I tested the patch, and it still only worked if the first component param was named like the entity type.
Attaching a patch that works (in my limited testing). The main change is to specify $entity_key instead of $entity_type in rules_action_set().
After that's done, rules_action() works properly even without the second parameter ($var . ':select') -> is there a difference between specifying it and not specifying it?
Comment #8
fago>Maybe an issue was fixed in the meantime?
Sounds so. I don't remember one though. Anyway, it shouldn't be required so let's better go without it.
>After that's done, rules_action() works properly even without the second parameter ($var . ':select') -> is there a difference between specifying it and not specifying it?
If you leave it out and there is no value, rules defaults to use the variable that has the same name as the parameter of the action. So if the action-parameter would be named different, it would stop working. Thus better add it in.
Comment #9
bojanz commentedCommitted: http://drupalcode.org/project/views_bulk_operations.git/commitdiff/c9899...
Thanks!