Unverified Commit add4d395 authored by alexpott's avatar alexpott

Issue #2973493 by Sam152: Remove @todo in content_moderation related to NULL...

Issue #2973493 by Sam152: Remove @todo in content_moderation related to NULL values of the moderation_state field
parent 7c6d4449
......@@ -203,7 +203,6 @@ protected function updateOrCreateFromEntity(EntityInterface $entity) {
$moderation_state = $workflow->getTypePlugin()->getInitialState($entity)->id();
}
// @todo what if $entity->moderation_state is null at this point?
$content_moderation_state->set('content_entity_revision_id', $entity_revision_id);
$content_moderation_state->set('moderation_state', $moderation_state);
ContentModerationStateEntity::updateOrCreateFromEntity($content_moderation_state);
......
......@@ -111,6 +111,9 @@ public function testSetEmptyState() {
unset($this->testNode->moderation_state);
$this->assertEquals('draft', $this->testNode->moderation_state->value);
$this->testNode->moderation_state = NULL;
$this->assertEquals('draft', $this->testNode->moderation_state->value);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment