Issue #2973493 by Sam152: Remove @todo in content_moderation related to NULL values of the moderation_state field
parent
7c6d4449d1
commit
add4d39507
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue