Skip to content

Fix missing publishedAt timestamp in Updater service - #12

Merged
ljonesfl merged 2 commits into
feature/service-architecturefrom
copilot/sub-pr-6-please-work
Nov 11, 2025
Merged

ljonesfl merged 2 commits into
feature/service-architecturefrom
copilot/sub-pr-6-please-work

Conversation

Copilot AI commented Nov 11, 2025 •

Copy link
Copy Markdown
Contributor

The Updater service was not setting publishedAt when changing post status to published, creating an inconsistency with Creator which sets it automatically.

Changes

  • src/Cms/Services/Post/Updater.php: Added business rule to auto-set publishedAt when status becomes STATUS_PUBLISHED (only if not already set)
  • tests/Cms/Services/Post/UpdaterTest.php: Added test coverage for the new behavior and preservation of existing timestamps
// Business rule: auto-set published date when changing to published status
if( $status === Post::STATUS_PUBLISHED && !$post->getPublishedAt() )
{
    $post->setPublishedAt( new \DateTimeImmutable() );
}

This prevents posts with STATUS_PUBLISHED but null publishedAt, matching the pattern established in Creator.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai

coderabbitai Bot commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: ljonesfl <1099983+ljonesfl@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on service architecture implementation Fix missing publishedAt timestamp in Updater service Nov 11, 2025
Copilot AI requested a review from ljonesfl November 11, 2025 03:20
@ljonesfl
ljonesfl marked this pull request as ready for review November 11, 2025 03:23
@ljonesfl
ljonesfl merged commit a049252 into feature/service-architecture Nov 11, 2025
2 checks passed
@ljonesfl
ljonesfl deleted the copilot/sub-pr-6-please-work branch November 11, 2025 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants