Watchdog logs were filling with:

Warning: usort() [function.usort]: Array was modified by the user comparison function in Workflow->sortTransitions() (line 469 of /xxxx/sites/all/modules/contrib/workflow/includes/Entity/Workflow.php)

and

Notice: Trying to get property of non-object in _workflow_transitions_sort_by_weight() (line 660 of /xxxx/sites/all/modules/contrib/workflow/includes/Entity/Workflow.php)

Created a patch that checks whether the objects are empty before attempting to use them in the usort() function.

CommentFileSizeAuthor
#1 2402169-1.patch699 bytesmicnap
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

micnap’s picture

FileSize
699 bytes

Patch attached.

johnv’s picture

This should not be possible. A transition always has two states. That function should not be called with NULLs in the list.
What is your use case?

micnap’s picture

The site I am working on has 0 set for some target_sid's. When a 0 is present the new_state_a/b variable is not an object so needed to account for that. Could be corrupt data that the target_sid is 0?

johnv’s picture

Indeed. Your tabel workflow_states should contain all configured States. There ID is a number, counting from 1.
Your table 'workflow_transitions' contains all configures Transitions. Bothe sid and target_sid should have a value > 0.

Are you only using the UI, or are you adding stuff programmatically?
Did you run update.php?

micnap’s picture

That makes sense. This is a new client and I'm not sure how or what was done in the past. Anything is possible.

johnv’s picture

Status: Active » Postponed (maintainer needs more info)
johnv’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I guess this is some anomaly in your installation.