Skip to content

Fix TimedPublishSubscriber for doctrine/dbal 4.x#3750

Open
Senne wants to merge 5 commits into
bolt:6.1from
Senne:fix/timed-publish-subscriber-dbal4
Open

Fix TimedPublishSubscriber for doctrine/dbal 4.x#3750
Senne wants to merge 5 commits into
bolt:6.1from
Senne:fix/timed-publish-subscriber-dbal4

Conversation

@Senne

@Senne Senne commented Jul 6, 2026

Copy link
Copy Markdown
  • Replace removed Connection::executeUpdate() with executeStatement()
  • Use plain (non colon-prefixed) named parameters as required by DBAL 4
  • Pass an explicit Types::DATETIME_MUTABLE type for the bound Carbon/DateTime value
  • Log caught exceptions at debug level instead of swallowing them silently

Fixes #3748

- Replace removed Connection::executeUpdate() with executeStatement()
- Use plain (non colon-prefixed) named parameters as required by DBAL 4
- Pass an explicit Types::DATETIME_MUTABLE type for the bound Carbon/DateTime value
- Log caught exceptions at debug level instead of swallowing them silently

Fixes bolt#3748
Copilot AI review requested due to automatic review settings July 6, 2026 08:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates TimedPublishSubscriber to work correctly with doctrine/dbal 4.x by using the supported DBAL APIs and correct parameter binding, and improves diagnostics by logging previously swallowed exceptions.

Changes:

  • Replace removed Connection::executeUpdate() calls with executeStatement().
  • Fix DBAL 4 named-parameter binding (no colon-prefixed keys) and bind Carbon with Types::DATETIME_MUTABLE.
  • Add debug-level logging when the subscriber catches an exception.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Event/Subscriber/TimedPublishSubscriber.php Outdated
Senne added 4 commits July 6, 2026 10:29
Typing $defaultConnection as the generic 'object' (as returned by
ManagerRegistry::getConnection()) hid the executeStatement() method from
PHPStan. Narrow it to Doctrine\DBAL\Connection instead, and drop the
now-obsolete baseline entry for the old executeUpdate() call.
Matches CI's ClassPropertyAssignToConstructorPromotionRector suggestion.
Clarify that the failure is silent for the user, but logged at debug level for diagnostics.
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.

TimedPublishSubscriber silently fails to publish/depublish content on doctrine/dbal 4.x

2 participants