From 6d497ffffa91c682d4812b51a6028ed483ece256 Mon Sep 17 00:00:00 2001 From: Daniel Bosen Date: Tue, 24 Sep 2024 10:23:36 +0200 Subject: [PATCH] Issue #3474835 by anacolautti: Scheduling a published content with content moderation unexpectedly unpublishes the content * Require scmi 3 * update actions/download-artifact * allow older version * also update upload artifact * tmate * Fix path to download * empty * Remove fix and run new test, this should fail * Reanable fix --------- Co-authored-by: Christian Fritsch --- composer.json | 2 +- .../ModeratedContentSchedulingTest.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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); + } /**