We had a discussion with Itangalo about the issue below :

http://drupal.org/node/914028

And it seems this issue isn't the only, many problems appear when we save a VBO action.

An exemple is when i create an action "Use signup object to execute a VBO programmatically" i choose the VBO view and operation "alter signup status" and select the status.

I save and i have succesfull message.

When i come back in the action, the status chossen is not selected.

So something goes wrong when we save a VBO action in Rules!

Comments

MasterChief’s picture

I forgot to say that "Alter signup status" VBO works manually :)

infojunkie’s picture

Can you reproduce this with "Use node object to execute a VBO programmatically" and an action such as "Change the author of a post"? On my side, the action arguments are being remembered.

If you can't reproduce it, please describe your steps in detail. Thanks for your help!

MasterChief’s picture

Hi infojunkie!

I made tests.

test 1:

I made a new rule with event : "After saving new content"

I created an action : "Use node object to execute a VBO programmatically"

I choosen the view admin_content (Default)

I choosen the operation "Change the author of a post" and save.

I created a new content (story)

And authors name change but i have an error message :

recoverable fatal error: Object of class stdClass could not be converted to string in C:\wamp\www\mysite\modules\syslog\syslog.module on line 106.recoverable fatal error: Object of class stdClass could not be converted to string in C:\wamp\www\mysite\sites\all\modules\devel\devel.module on line 430.

test 2:

I made a new rule with event : "A user signup to a node"

I created an action : "Use node object to execute a VBO programmatically"

I choosen the view admin_content (Default)

I choosen the operation "Change the author of a post" and save.

---------------------------------------------------------------------------------------------------

I created an action : "Show a configurable message on the site"

I made a message and save.

After i signup to a node, i see the message i made but author doesn't change and i don't have a message for the author's change (nothing happens ?).

PS:

In the tests for action "Use node object to execute a VBO programmatically" the parameters are remembered.

infojunkie’s picture

For the second test, note that the node where you signed up is not necessarily the one to be modified. Instead, the nodes that are selected by VBO are the ones being modified. Can you verify that?

If you want to debug further, replace the VBO action "change the author of a post" with "Execute arbitrary PHP script" and set the script to

dsm($object);

When you signup to a node, what gets printed?

MasterChief’s picture

I changed action and set script to : "dsm($object);"

When i signup to a node, nothing else appear!

infojunkie’s picture

Are you sure that the VBO returns any results? The typical setup is to set the VBO with an argument that is the node where the signup occurs. Can you preview the VBO in the Views admin page, passing it the same argument and checking if there's a result?

MasterChief’s picture

I see in the views admin page that arguments are : (Signup node) Node: Nid

So i add in operation argument return array$object->nid);

But devel message doesn't appear yet.

PS :

We can talk in #drupal on irc if you want, it will be maybe more easy for tests.

MasterChief’s picture

Do you have an idea why nothing happens ?

infojunkie’s picture

Not off the top of my head but I suspect an error in settings. I'm on IRC, same username.

MasterChief’s picture

StatusFileSize
new82.42 KB

Here the screenshot!

MasterChief’s picture

StatusFileSize
new84.2 KB

Here a second screenshot.

MasterChief’s picture

StatusFileSize
new65.38 KB

Here the view configuration :)

MasterChief’s picture

StatusFileSize
new240.97 KB

In attachment the signup module with patches :)

MasterChief’s picture

StatusFileSize
new1.65 KB
new3.5 KB

And now the rules.

MasterChief’s picture

You must install signup_status 6.x-1.x-dev.

In attachment, i made 3 screenshots of signup configuration.

You need to make a content type with a date field.

After you must edit the content type, you go in Signup Settings and check => Enabled (on by default).

Create a content, go in full node and you will be able to signup.

MasterChief’s picture

Just for information, to fix the message in test 1, i found the solution :

http://drupal.org/node/403034

MasterChief’s picture

Hi infojunkie!

joachim in #40 and fago in #45 make some advices for the signup rules integration patch in http://drupal.org/node/595414

Do you think what they say could be one thing of the problem ?

Did you find time to test ?

Thank for your answer :)

PS:

Je te souhaite une bonne journée :)

infojunkie’s picture

Hi MasterChief, I started testing but could not reproduce the whole scenario... I'll try again when I get some more time. Sorry!

MasterChief’s picture

Hi infojunkie!

Thanks for your answer :)

PS :

À bientôt!

MasterChief’s picture

Hi infojunkie!

I saw your posts on other issues, the problem here is linked with these issues no ?

http://drupal.org/node/987786

http://drupal.org/node/979852

infojunkie’s picture

Actually, the issue #987440: Operation options in rules for "execute a VBO programmatically" shouldn't show up unless enabled in the view. might have caused you this trouble. Please try the latest dev and let me know if there's any improvement.

MasterChief’s picture

I tested the new dev version, now the action cancel a signup work with a node object but i have 2 issues :

- All signups are cancel

- It works only with the admin account, when another user signup (it's the event), the VBO action do nothing

The second problem is the worst i think.

Do you have an idea how to fix this ?

MasterChief’s picture

Hi infojunkie !

I solved a problem when i activated in actions_permissions module the right to execute Cancel signup (signup_cancel_action).

The only problem now is when an user make the event to cancel a signup, all signups are cancel.

I test with :

dsm($object);

and all datas in the signup object are good, so what you think i must enter to solve this problem?

infojunkie’s picture

Make sure your argument is reaching the view correctly:

1. Test your argument with your VBO manually.
2. Make sure the view arguments in the Rules action is set up properly. Before the line return array(...), add a dsm(...) that shows you the argument that will be sent to the VBO.

MasterChief’s picture

StatusFileSize
new18.05 KB
new57.36 KB

Hi again!

I make 2 screenshots, one of the view and the other the datas in the object(devel).

I see relationships with the view, the problem isn't with this ?

Thanks for your answer.

infojunkie’s picture

I think I found a bug with VBO passing the argument to Views 3. I'll update this thread with the result.

infojunkie’s picture

No, sorry, false alarm. Arguments are being passed correctly.

If I understand your latest screenshots correctly, you are using a view that accepts a node nid as argument. However, the object you are passing to it is a full Signup object. Instead, you should be passing the node nid only:

return array($object->nid);
MasterChief’s picture

I tried this, but the problem is that it works, but it works too well because it cancel all signups in the correct node, not only the user's signup.

When i used the view manually i tick the user i want and i choose the bulk operation and click on execute.

So how can i say to the vbo action that i want just the correct user, because when we check the object i have this information with the uid or sid.

Just for information i am using the latest dev of Views 3.

infojunkie’s picture

When i used the view manually i tick the user i want and i choose the bulk operation and click on execute.

Where do you tick it?

MasterChief’s picture

StatusFileSize
new25.79 KB

On the node i click on the tab signups and i am on the view.

I am attaching the screenshot.

infojunkie’s picture

You need to add an additional argument that is the user you want. The VBO action applies the action to all view results, so it's your responsibility to make sure the view results are the ones you need.

MasterChief’s picture

So what you say is than i must add an argument in the configuration of the view isn't it ?

infojunkie’s picture

Yes that's what you need to do.

MasterChief’s picture

Ok i follow your advice and it works now!

Thank you very much for all your time you took for me :)

infojunkie’s picture

Category: bug » support
Status: Active » Fixed

Glad to hear it :-)

Status: Fixed » Closed (fixed)

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