Fix "TypeError: 'NoneType' object is not iterable" on scheduler task
Restore the State field to Project Task

For the cases where some 7.0 processes still rely on the `state` field.
Merge branch 'add-task-state' into 8.0