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

kratib - February 5, 2009 - 20:57
Version:6.x-1.4» 6.x-1.x-dev
Assigned to:Anonymous» kratib
Status:active» fixed

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

eff_shaped - February 18, 2009 - 16:36

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

kratib - February 18, 2009 - 16:53
Status:fixed» active

Well it was supposed to be fixed. Can you tell me which action you're trying to apply when you get this error?

#4

eff_shaped - February 18, 2009 - 17:02

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

kratib - February 19, 2009 - 09:05

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

eff_shaped - February 19, 2009 - 11:04

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

eff_shaped - February 19, 2009 - 11:06

testing reply after errors

#8

eff_shaped - February 19, 2009 - 11:06

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

eff_shaped - February 19, 2009 - 11:29

ok, looks like replies were posted, despite those error messages

#10

eff_shaped - February 19, 2009 - 11:30
AttachmentSize
ModulesEnabledFeb19.pdf 51.06 KB

#11

kratib - February 19, 2009 - 18:40

Instead of Views Bulk Operations 6.x-1.4, you need the latest Views Bulk Operations 6.x-1.x-dev.

#12

eff_shaped - February 23, 2009 - 12:07

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

kratib - February 23, 2009 - 19:43
Status:active» fixed

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

System Message - March 9, 2009 - 19:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.