diff --git a/composer.json b/composer.json index 4a0390142..21bf5efae 100644 --- a/composer.json +++ b/composer.json @@ -96,7 +96,7 @@ "drupal/responsive_preview": "^2.1", "drupal/redirect": "^1.7", "drupal/scheduler": "^2.0.2", - "drupal/scheduler_content_moderation_integration": "^2.0", + "drupal/scheduler_content_moderation_integration": "^2.0||^3.0", "drupal/schema_metatag": "^2.4", "drupal/select2": "^1.7", "drupal/search_api_mark_outdated": "^1.0", diff --git a/tests/src/Functional/ModeratedContentSchedulingTest.php b/tests/src/Functional/ModeratedContentSchedulingTest.php index f1fd2d828..4abdd5251 100644 --- a/tests/src/Functional/ModeratedContentSchedulingTest.php +++ b/tests/src/Functional/ModeratedContentSchedulingTest.php @@ -91,6 +91,22 @@ public function testPublishStateSchedule(): void { $this->assertEquals('published', $node->moderation_state->value); $this->assertEquals('Test workflow article 1 - Draft', $node->getTitle()); + // Test published to published. + // See: https://www.drupal.org/project/thunder/issues/3474835 + $this->drupalGet($edit_url); + $this->submitForm([ + 'title[0][value]' => 'Test workflow article 1 - Still Published', + 'moderation_state[0]' => 'published', + 'publish_on[0][value][date]' => date('Y-m-d', $publish_timestamp), + 'publish_on[0][value][time]' => date('H:i:s', $publish_timestamp), + 'publish_state[0]' => 'published', + ], 'Save'); + $node_storage->resetCache([$node->id()]); + /** @var \Drupal\node\Entity\Node $node */ + $node = $node_storage->loadRevision($node_storage->getLatestRevisionId($node->id())); + $this->assertEquals(TRUE, $node->isPublished()); + $this->assertEquals('published', $node->moderation_state->value); + } /**