Each time I save or edit a content type which is not linked to the workflow module I get this error:

Notice: Trying to get property of non-object in workflow_node_previous_state() (line 817 of C:\wamp\www\cloudtutr\sites\all\modules\workflow\workflow.module).
Notice: Trying to get property of non-object in workflow_node_previous_state() (line 817 of C:\wamp\www\cloudtutr\sites\all\modules\workflow\workflow.module).

Comments

Bastlynn’s picture

Status: Active » Needs review

I've added an immediate fix in the dev branch of Workflow to address this. Please let me know if the dev version works for you now.

onegenius’s picture

There is still an error.

Notice: Trying to get property of non-object in workflow_node_previous_state() (line 791 of /home3/generaq7/public_html/cloudtutr/sites/all/modules/workflow/workflow.module).

I checked it out, this seems to fix it.
Replace:

    if (isset($last_history)) {
      $sid = $last_history->sid;
    }

With:

$sid = !$last_history ? false : $last_history->sid;

Or just check if $last_history is an object.

Bastlynn’s picture

Status: Needs review » Closed (fixed)

Done and committed to dev, thanks!

b-prod’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new693 bytes

Here is a patch against the current release for immediate fix.

The "need review" state is not about the current patch but about this point:
I think the lines 779 ($sid = -1;) and 785 ($sid = FALSE;) are no more necessary and should be removed.

pacufist’s picture

Any progress so far?

nancydru’s picture

Status: Needs review » Closed (fixed)

As Sarah said, this was committed and is in the -dev release.