Issue #2973493 by Sam152: Remove @todo in content_moderation related to NULL values of the moderation_state field

8.6.x
Alex Pott 2018-05-17 10:48:51 +01:00
parent 7c6d4449d1
commit add4d39507
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
2 changed files with 3 additions and 1 deletions

View File

@ -203,7 +203,6 @@ class EntityOperations implements ContainerInjectionInterface {
$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);

View File

@ -111,6 +111,9 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
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);
}
/**