Hi,

I can reproduce this error :
"
Notice : Undefined property: stdClass::$workflow dans workflow_node_update() (ligne 240 dans /var/www/drupal_test/sites/all/modules/workflow/workflow.module).
"
when I update a node associated with a workflow with only one step.

With module Devel, I saw that there is not workflow property on the node, while with a workflow with more than 1 step, it works.

Rights are ok.
Drupal v7.22

Thank you
Sim

Comments

kiricou’s picture

I forgot something : with older versions, it worked and I saw with Devel that there is the workflow property set.

Sim

nancydru’s picture

Is there a use case for a single step workflow?

DruZone’s picture

Hi Nancy,

I get the same error:
Notice: Undefined property: stdClass::$workflow in workflow_node_update() (line 240 of .../workflow/workflow.module).

However in my case, I have 6 steps shared across three roles, that is 2 steps in each role.
The error happens whenever I update a node contributing in the workflow.

Any idea what could be the cause of that issue ?

Thank you

Drupal v7.22
Workflow 7.x-1.1
Workflow Content Permissions 7.x-1.0

DruZone’s picture

Hi Nancy,

I get the same error:
Notice: Undefined property: stdClass::$workflow in workflow_node_update() (line 240 of .../workflow/workflow.module).

However in my case, I have 6 steps shared across three roles, that is 2 steps in each role.
The error happens whenever I update a node contributing in the workflow.

Any idea what could be the cause of that issue ?

Thank you

Drupal v7.22
Workflow 7.x-1.1
Workflow Content Permissions 7.x-1.0

nancydru’s picture

I did find a small issue with workflow_node_load(), so it may be fixed shortly.

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

Please download the latest dev code and see if this is still an issue.

jmymlr’s picture

I installed the Dev code and ran the database update. I'm no longer getting the "Notice : Undefined property:" but now I'm getting the messages below on every node page.

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'workflow_tab_form' not found in drupal_retrieve_form() (line 798 of C:\Program Files (x86)\EasyPHP-12.0\www\aapi\includes\form.inc).
    Notice: Array to string conversion in drupal_prepare_form() (line 1048 of C:\Program Files (x86)\EasyPHP-12.0\www\aapi\includes\form.inc).
    Notice: Array to string conversion in drupal_prepare_form() (line 1062 of C:\Program Files (x86)\EasyPHP-12.0\www\aapi\includes\form.inc).
    Notice: Array to string conversion in drupal_prepare_form() (line 1082 of C:\Program Files (x86)\EasyPHP-12.0\www\aapi\includes\form.inc).
nancydru’s picture

What is "EasyPHP-12.0"?

I am not seeing this on my test site.

jmymlr’s picture

It's my WAMP server. http://www.easyphp.org/

the webroot starts after aapi\

nancydru’s picture

Are you getting the Workflow tab?

jmymlr’s picture

Yes, I'm getting the Workflow tab.

nancydru’s picture

But not the state change form on the node view? Do you have any other workflow-related modules?

jmymlr’s picture

I'm running Workflow Extensions 7.x-1.0-beta3, which I'm using to replace the standard state change form with a block.

jmymlr’s picture

Update:

I updated to the Dev build from 5/16 and still got the same errors from #7, so then I disabled Workflow Extensions and I no longer get the errors.

My client really prefers the buttons from Workflow Extensions, so disabling really isn't an option for me. Any suggestions on where to look from here?

nancydru’s picture

I work fairly closely with Rik and we've dealt with this. Are you using his latest code? I'm using 7.x-1.0-beta3 of Workflow Extensions.

nancydru’s picture

Status: Postponed (maintainer needs more info) » Active

I am now seeing this is a site that has a complicated workflow. I am beginning to it's in the Workflow Extensions "Change Workflow State" block. Are you using that?

jmymlr’s picture

Yes, I'm on 7.x-1.0-beta3 of Workflow Extensions and am using the "Change Workflow State" block.

nancydru’s picture

Just out of curiosity, which Drupal and PHP versions?

nancydru’s picture

Title: Pb with worflow with only one step » 'workflow_tab_form' not found
Project: Workflow » Workflow Extensions
Version: 7.x-1.1 » 7.x-1.0-beta3

Moving to Workflow Extensions.

Rik: I removed workflow_extensions_forms() and this issue disappeared. Prior to that, the form themes were seeing an array rather than a string. I'm guessing it's because both WE and Workflow had hook_forms() implementations.

If you want to be flexible, then this should do it:

function workflow_extensions_forms($form_id, $args) {
  if (function_exists('workflow_forms')) {
    return array();
  }
  if (strpos($form_id, 'workflow_tab_form_nid') === 0) {
nancydru’s picture

The Workflow patch is applied.

kristen pol’s picture

I'm seeing this error and am using the latest -dev versions of workflow and workflow_extensions. I'll see if I can debug.

kristen pol’s picture

I'm onto something... I see there are two workflow_tab_form items in the callback and if I remove one (hack) then it renders and the errors are gone. I'll see if I can figure out why there are two in there.

kristen pol’s picture

If I comment out the form definition here:

function workflow_extensions_forms($form_id, $args) {
  /*
  if (strpos($form_id, 'workflow_tab_form_nid') === 0) {
    $form = array(
      $form_id => array(
        'callback' => 'workflow_tab_form',
        'callback arguments' => array(),
      ),
    );
    return $form;
  }
  */
}

Then there error is gone and the workflow state form shows up in my view. But, when I click one of the transition buttons from within the views UI, I get some ajax errors. But, if I use it directly from the regular page (where the view shows up), then it works fine.

Perhaps there is a better way to remove the duplicate and maybe this form registration is needed for other things? I've included a patch that removes this function entirely but I'm not sure that is the best approach.

kristen pol’s picture

Status: Active » Needs review
nancydru’s picture

Status: Needs review » Active

Kristen, I was getting that until I did #19.

kristen pol’s picture

Der... I misunderstood and thought that #20 meant that dev was updated with all changes from #19... I guess I should have read it more carefully!!!! :/ I can roll a patch with your change.

kristen pol’s picture

Status: Active » Needs review
StatusFileSize
new994 bytes

Here's a patch with changes from @NancyDru... ready for testing. It works great for me.

rdeboer’s picture

Status: Needs review » Fixed

Patch from #20/#27 applied with attribution to Nancy.
Available in the next dev snapshot 7.x-1.x-dev.
Thanks Kristen for reaching the same conclusion and for testing.
Rik

kristen pol’s picture

Thanks for committing so quickly! :)

nancydru’s picture

Thanks, Rik.

rdeboer’s picture

Pleasure, Nancy.
I may call this version 7.x-1.0-beta4.
I still haven't done the tokens for us on the buttons. It may have to be a stable but incomplete release... just very busy at the mo.
Rik

Status: Fixed » Closed (fixed)

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

jmymlr’s picture

Thanks to Rik, Nancy and Kristen. This was a big help.