Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2402169-1.patch | 699 bytes | micnap |
Comments
Comment #1
micnap CreditAttribution: micnap commentedPatch attached.
Comment #2
johnvThis 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?
Comment #3
micnap CreditAttribution: micnap commentedThe 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?
Comment #4
johnvIndeed. 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?
Comment #5
micnap CreditAttribution: micnap commentedThat makes sense. This is a new client and I'm not sure how or what was done in the past. Anything is possible.
Comment #6
johnvComment #7
johnvI guess this is some anomaly in your installation.