* warning: call_user_func(views_bulk_operations_ruleset_action_one_submit) [function.call-user-func]: First argument is expected to be a valid callback in /var/www/artsci/export2/home/artsci/facstaff/deans/cdrupal6/public_html/sites/afar.artsci.wustl.edu/modules/views_bulk_operations/views_bulk_operations.module on line 936.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/artsci/export2/home/artsci/facstaff/deans/cdrupal6/public_html/sites/afar.artsci.wustl.edu/modules/views_bulk_operations/views_bulk_operations.module on line 1469.

This error does not occur when initially configuring the action - only when editing it.

Below is an export of the triggered rule:

array (
'rules' =>
array (
'rules_41' =>
array (
'#type' => 'rule',
'#set' => 'event_flag_flagged_report_complete',
'#label' => 'Remove editing privileges and mark all related content complete',
'#active' => 1,
'#weight' => '0',
'#categories' =>
array (
),
'#status' => 'custom',
'#conditions' =>
array (
0 =>
array (
'#type' => 'condition',
'#settings' =>
array (
'type' =>
array (
'profile' => 'profile',
),
'#argument map' =>
array (
'node' => 'node',
),
),
'#name' => 'rules_condition_content_is_type',
'#info' =>
array (
'label' => 'Flagged content is Faculty Profile',
'arguments' =>
array (
'node' =>
array (
'type' => 'node',
'label' => 'Content',
),
),
'module' => 'Node',
),
'#weight' => 0,
),
),
'#actions' =>
array (
0 =>
array (
'#type' => 'action',
'#settings' =>
array (
'field_name' => 'field_report_submitted_date',
'#argument map' =>
array (
'node' => 'node',
),
'value' =>
array (
0 =>
array (
'value' => NULL,
'value2' => NULL,
'timezone' => NULL,
'offset' => NULL,
'offset2' => NULL,
'rrule' => NULL,
),
),
'code' => '$now = date(\'Y-m-d\'). \'T00:00:00\';
return array(0 => array(\'value\' => $now));',
'vars' =>
array (
),
),
'#name' => 'content_rules_action_populate_field',
'#info' =>
array (
'label' => 'Populate flagged content\'s field \'field_report_submitted_date\'',
'arguments' =>
array (
'node' =>
array (
'type' => 'node',
'label' => 'Content',
),
),
'eval input' =>
array (
0 => 'code',
),
'module' => 'CCK',
),
'#weight' => -4,
),
1 =>
array (
'#weight' => 0,
'#info' =>
array (
'label' => 'Execute a VBO programmatically on node',
'arguments' =>
array (
'object' =>
array (
'type' => 'node',
'label' => 'Object',
),
),
'module' => 'Views Bulk Operations',
'eval input' =>
array (
),
'base' => 'rules_core_action_execute',
'action_name' => 'views_bulk_operations_action',
'configurable' => true,
),
'#name' => 'views_bulk_operations_action_node',
'#settings' =>
array (
'view_vid' => '6',
'operation_key' => 'views_bulk_operations_ruleset_action_rules_remove_edit_own',
'operation_arguments' => '',
'view_exposed_input' => '',
'view_arguments' => 'return array($object->uid);',
'#argument map' =>
array (
'object' => 'node',
),
),
'#type' => 'action',
),
),
'#version' => 6003,
),
),
)

CommentFileSizeAuthor
#9 914028.patch8.51 KBinfojunkie

Comments

jastraat’s picture

Version: 6.x-1.10-beta2 » 6.x-1.10

This is still a problem in the new official release.

itangalo’s picture

Title: Error if editing 'Execute a VBO programmatically on node' action after it is created » Conflict with PHP Filter module

I think I've nailed down the problem to a conflict with the core PHP Filter module. I got similar errors (after a white screen), and it only appears when the PHP Filter module is enabled.

@jastraat: Could you try turning of PHP Filter and see if the error messages disappears?

Changing the title to reflect my suspicions.

To replicate bug:

* Create a VBO that takes at least one argument.
* Turn on PHP Filter module.
* Create a triggered rule with an action that calls the VBO programmatically. In the view argument settings, type somthing like return array($object->nid);.
* Try to save the action.

Saving the action will result in a blank page. When backing to the configuration page, an error message similar to the one in the top post will apperar.
When turning off the PHP Filter module everything works as expected.

itangalo’s picture

Title: Conflict with PHP Filter module » 'Execute a VBO programmatically on node' actions can't be edited and resaved

OK, some more checks, and I must admit that I had it all wrong. Just as jastraat says: the problem is that you can't edit and resave the action once you've created it.

(Jeez, it is scary how you can get hooked on some patterns you think you see.)

Sorry for the confusion. Changing the title again.

milos.kroulik’s picture

subscribe

infojunkie’s picture

I see the failure concerns invoking a ruleset from within the VBO action. Is this the case for all posters? Can you confirm that calling another action (e.g. "Publish node") from the VBO action does not cause this problem?

infojunkie’s picture

Nerver mind #5: I was able to reproduce this.

infojunkie’s picture

Version: 6.x-1.10 » 6.x-1.x-dev
Status: Active » Fixed

Fixed in latest dev. Please try it and let me know how it works.

I'd be especially grateful if you could test that the VBO action executes properly when triggered by Rules.

jastraat’s picture

Could you attach the relevant patch?

infojunkie’s picture

StatusFileSize
new8.51 KB

Patch attached.

itangalo’s picture

I tried the patch on VBO 1.10, but it resulted in error messages when I tried to save the VBO actions:

    * warning: call_user_func(node_publish_action_submit) [function.call-user-func]: First argument is expected to be a valid callback in /Users/johan/Sites/101013/sites/all/modules/views_bulk_operations/views_bulk_operations.module on line 971.
    * warning: array_merge() [function.array-merge]: Argument #2 is not an array in /Users/johan/Sites/101013/sites/all/modules/views_bulk_operations/views_bulk_operations.module on line 1506.
    * warning: array_merge() [function.array-merge]: Argument #2 is not an array in /Users/johan/Sites/101013/sites/all/modules/views_bulk_operations/views_bulk_operations.rules.inc on line 57.

The action got saved, but when revisiting it no view and action were selected. (Probably all configuration was lost.)

Sorry for bad news. :-(

jastraat’s picture

I'm afraid I also had an error with the above patch when attempting to save an existing VBO action:
Fatal error: Unsupported operand types in ../all/modules/rules/rules/modules/rules.rules.inc on line 406

* warning: call_user_func(views_bulk_operations_ruleset_action_one_submit) [function.call-user-func]: First argument is expected to be a valid callback in ../modules/views_bulk_operations/views_bulk_operations.module on line 971.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in ../modules/views_bulk_operations/views_bulk_operations.module on line 1506.

itangalo’s picture

Status: Fixed » Needs work

Changing status to 'needs work'.

PS: Also tested on dev version, but the patch didn't apply correctly and didn't make much difference.

infojunkie’s picture

Can you please test the latest dev without the patch? What version of Rules are you using?

itangalo’s picture

New test results!

* It seems to work fine when standard actions are chosen as the VBO action.
* It breaks when rule sets are called as actions, with the effects described in #10.

This might thus be a bug in Rules (but doesn't have to be).

I'm using Rules 1.3, but also tried on dev (which for some strange reason was *older* than the 1.3 release). Same effect.

itangalo’s picture

More new test results!

* It seems to work fine for rule sets with two (I guess multiple) arguments.
* It breaks as described above for rule sets with one or zero arguments.

infojunkie’s picture

@Itangalo: Thanks very much! The code for zero and one arguments is indeed different from multiple args. That helps a lot.

infojunkie’s picture

Issue tags: +r1.11

Tagging for next release.

adraskoy’s picture

subscribe

nodecode’s picture

subscribe

MasterChief’s picture

I have the same problem, is it will be fix soon ?

itangalo’s picture

@MasterChief: There is an ugly workaround if it is critical for your functions – just make another argument for the rule set (without ever using its content). It will be a bit more difficult to configure the action that calls the VBO, but it will work.

(You can't add arguments to rule sets once they are created, but if you look in the export code from a rule set it is pretty easy to add a new argument with copy-paste – and then import the result.)

MasterChief’s picture

Could you give me an example of what you put in view arguments in a VBO action because i have always the same error message.

itangalo’s picture

For the view argument settings, I use something like this:

return array(
  $object->nid,
  'static_value',
  arg(1),
);

This would send three argument to Views – the node ID of the node used to execute VBO (as configured in the Rules action), a static value, and the second(!) part of the path – '17' if the current path is 'node/17'.

MasterChief’s picture

Hi Itangalo, thanks for your answer!

My action is 'Use signup object to execute a VBO programmatically'.

I tried a code like this :

return array(
  $object->sid,
  '494',
  $object->uid,
);

and this too :

return array(
  $object->sid,
  '494',
  arg(1),
);

but i have always this error message :

* warning: call_user_func(signup_cancel_action_submit) [function.call-user-func]: First argument is expected to be a valid callback in C:\wamp\www\mysite\sites\all\modules\views_bulk_operations\views_bulk_operations.module on line 972.
    * warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\wamp\www\mysite\sites\all\modules\views_bulk_operations\views_bulk_operations.module on line 1507.
    * warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\wamp\www\mysite\sites\all\modules\views_bulk_operations\views_bulk_operations.rules.inc on line 57.

The object is a signup object.

Do you have an idea to fix this?

itangalo’s picture

Some clarification!

The error messages in #24 appears when saving the action, not when executing the rule.

The phrase "call_user_func(signup_cancel_action_submit)" seems a bit strange – my guess is that it should be "call_user_func('signup_cancel_action_submit')".

My initial guess is that it is something wrong from the Signup module's part, but discussion with MasterChief relealed that similar problems occur even when using a user object to execute a VBO.

There will probably be another bug report from MasterChief.

MasterChief’s picture

I had a discussion with Itangalo and it seems that something goes wrong with VBO when we use Rules, so i will open another issue because this issue isn't the only.

infojunkie’s picture

Status: Needs work » Needs review

I've committed a fix for #10 and #24 above. Please try the latest dev (12 hours from now) and let me know!

MasterChief’s picture

Hi infojunkie, thanks for your answer!

I will try it when it will be available to download, i will tell you today if it's works :)

MasterChief’s picture

I don't have anymore the error message so now i can save but i have still the problem of #1 in this issue :

http://drupal.org/node/977144

infojunkie’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

niklp’s picture

Oh thank God!

I lost a LOT of time on fixing an error very similar to this. Almost impossible to debug! Pretty please make a new point release now - it's been a good few months?