As an experiment I've merged core from 8.3.x branch to try out workflow. After successfully assigning 'editorial workflow' to articles and pages, I cannot access the pages or articles anymore neither to read them as a guest or to edit them as an admin.
Visiting /admin/reports/status, I see this error:
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Comment
The Publishing status field needs to be updated.
My expectation is that the existing entities needs their workflow states to be set, but I expected the workflow module to automatically assign 'published' state to published articles. How can I fix that?
I was wrong about that this was only happening with existing articles. Another article after been created as well started behaving the same.
This was the error from log:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'content_moderation_state_field_data.workflow' in 'where clause': SELECT base_table.revision_id AS revision_id, base_table.id AS id FROM {content_moderation_state} base_table INNER JOIN {content_moderation_state_field_data} content_moderation_state_field_data ON content_moderation_state_field_data.id = base_table.id WHERE (content_moderation_state_field_data.content_entity_type_id IN (:db_condition_placeholder_0)) AND (content_moderation_state_field_data.content_entity_id IN (:db_condition_placeholder_1)) AND (content_moderation_state_field_data.workflow IN (:db_condition_placeholder_2)) AND (content_moderation_state_field_data.default_langcode IN (:db_condition_placeholder_3)); Array ( [:db_condition_placeholder_0] => node [:db_condition_placeholder_1] => 8 [:db_condition_placeholder_2] => editorial [:db_condition_placeholder_3] => 1 ) in Drupal\Core\Entity\EntityStorageBase->loadByProperties() (line 503 of \core\lib\Drupal\Core\Entity\EntityStorageBase.php)." Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE…