Using workflow actions results in PHP error
NickSI - February 5, 2009 - 14:51
| Project: | Views Bulk Operations (VBO) |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | kratib |
| Status: | closed |
Description
When using workflow advanced action (and probably any action with predefined call arguments) PHP gives me
"Unsupported operand types in view_bulk_operations.module on line 362"
Changing this line from:
$params += $operation['callback arguments'];
To
$params[] = $operation['callback arguments'];
fixes this problem

#1
Thanks for the report! That was a regression introduced a while back. It's now fixed in the 6.x-1.x-dev branch.
Note that your fix is not correct. The code above is needed for node_operations and user_operations, which store the callback arguments in an array that needs to be concatenated with, not contained within, the $params variable. Your fix "worked" because in the case of actions with predefined arguments, the Action API pulls the arguments from database at the time of invocation. So the $params content was simply ignored then. What I did was to convert the predefined args to array (using unserialize) so that PHP doesn't complain about that particular case.
#2
I think I have the same/similar problem. Can anyone explain what we can do about this. Particularly without doing any coding.
Do I need to download/install something different?
I'm following the Using Drupal Book (O'Rielly), Chapter 6; Hands-on Building an Administration Page.
Tried to approve a post, with bulk operations in the workflow summary screen.
I got this message:
Fatal error: Unsupported operand types in /public_html/xxxx/sites/all/modules/views_bulk_operations/views_bulk_operations.module on line 362
I'm using: Views Bulk Operations 6.x-1.4; Workflow 6.x-1.x-dev; Drupal 6.9
#3
Well it was supposed to be fixed. Can you tell me which action you're trying to apply when you get this error?
#4
wow, you're fast!
am trying to take a story from Draft to Approved.
So I'm checking the row in the workflow summary:
"Article publication: Draft Extra! first story created under new workflow Story"
And then selecting 'Approve post' and clicking Execute.
I get the confirmation page:
[Are you sure you want to perform 'Approve post' on selected rows?
[
[You selected the following 1 rows:
[ * Extra! first story created under new workflow
[Confirm
On confirm I get the Fatal Error message page.
#5
I was able to find a copy of the book online, so I followed your scenario :-)
Unfortunately, the error did not occur on my side. Are you sure you have the latest VBO 6.x.1.x-dev release?
#6
I'm using: Views Bulk Operations 6.x-1.4; Workflow 6.x-1.x-dev
I have not been using the installation code from the book - I have some modules enabled that might not be in the book scenario. I can send them to you if needed.
(I just tried attaching pdf of the list of my modules to this reply, but got an error from drupal site!).
Before starting with VBO, I went backwards to the Workflow 6.x-1.x-dev version, because I was getting errors to do with triggers:
"warning: Missing argument 1 for trigger_access_check() in /home/xxxxxxxx/public_html/_drupal_test/modules/trigger/trigger.module on line 129."
And took advice from the issue thread -- http://drupal.org/node/310439
thanks so much, kratib
#7
testing reply after errors
#8
testing reply after errors
Fatal error: Call to undefined function project_project_set_breadcrumb() in /var/www/drupal.org/htdocs/sites/all/modules/project_issue/project_issue.module on line 1236
#9
ok, looks like replies were posted, despite those error messages
#10
#11
Instead of Views Bulk Operations 6.x-1.4, you need the latest Views Bulk Operations 6.x-1.x-dev.
#12
I installed the latest Views Bulk Operations 6.x-1.x-dev.
I am now able to move the story from Draft state to Approved. Thanks for that, it works!.
I found that I also needed to edit the workflow for Article Publication to allow the role I was using to do the transition. Could this have been part of the hiccup before?
______________________________________
Of course, this leads me to further questions...
Should I be concerned that I'm getting update alerts from not using the recommended versions of modules?
How do I know when it's time to update these, if I'm using this current configuration to make sure it all works right?
My updates report says:
Workflow 6.x-1.x-dev (2009-Jan-07)
Recommended version: 6.x-1.1 (2009-Jan-07)
Development version: 6.x-1.x-dev (2009-Jan-07)
Views Bulk Operations 6.x-1.x-dev (2009-Feb-23)
Recommended version: 6.x-1.4 (2009-Feb-04)
#13
You need to understand the Drupal release mechanism: you get alerts concerning your module updates only when there's a new official release (not a -dev update). In your case, the fix to the bug reported above was introduced in VBO after release 1.4, and that's why it is included in the -dev updates (whose date is later than the 1.4 release date). When I release VBO 1.5 (some time this week), you will get notified that a new version is available - and this version will also contain the needed fix.
#14
Automatically closed -- issue fixed for 2 weeks with no activity.