Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Summary:
Using content_moderation block on node view page throws error when node has never been published.
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Entity\EntityStorageException</em>: The state '' does not exist in workflow.' in <em class="placeholder">Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()</em> (line <em class="placeholder">805</em> of <em class="placeholder">core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php</em>).
Replicate:
Using Lightning 3.0.1 (no error on Clean D8.4 install w/o Lightning)
- Install Lightning
- Create Basic page, save as DRAFT
- In 'view' mode, select 'In Review': Throws error and does not change state.
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Entity\EntityStorageException</em>: The state '' does not exist in workflow.' in <em class="placeholder">Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()</em> (line <em class="placeholder">805</em> of <em class="placeholder">core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php</em>)
- In 'view' mode, select 'Published': Throws error,
Notice: Undefined property: Drupal\node\Entity\Node::$moderation_state in Drupal\content_moderation\ModerationInformation->isDefaultRevisionPublished() (line 183 of core/modules/content_moderation/src/ModerationInformation.php).
- Once page has been published, content works just fine.
Comments
Comment #2
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #3
phenaproximaComment #4
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedThis should be fixed now. Anyone able to test?
Comment #5
phenaproxima"Should be fixed" now, followed by 3+ years of inactivity in this issue, suggests that it's either fixed or superseded by this point. :) I think it's time to close this one out.