Problem/Motivation

As noted in #3177660: Remove public properties from StatementInterface implementations and commented in https://git.drupalcode.org/project/drupal/-/merge_requests/68#note_5800,

[...] it seems that this option is not used at all in core runtime, only to prevent exceptions being thrown in some tests - probably dating back to pre-PHPUnit era. That entire option seems vestigial at this point, we may think to remove it [...]

Proposed resolution

  • Deprecate the option
  • Remove its usages

Remaining tasks

None

User interface changes

None

API changes

The query option "throw_exception" has been deprecated. The default value for the option will be how it works in D10.

Data model changes

None

Release notes snippet

N/a

Issue fork drupal-3189680

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Title: Deprecate the 'throw_exception' option in the Database API » [PP-1] Deprecate the 'throw_exception' option in the Database API
Status: Active » Postponed
Related issues: +#3186934: Introduce an ExceptionHandler class in the database API, deprecate Connection::handleQueryException
mondrake’s picture

Title: [PP-1] Deprecate the 'throw_exception' option in the Database API » Deprecate the 'throw_exception' option in the Database API
Assigned: Unassigned » mondrake
Status: Postponed » Active

On this.

mondrake’s picture

Assigned: mondrake » Unassigned
Status: Active » Needs review
mondrake’s picture

Rerolled

daffie’s picture

Status: Needs review » Needs work

There is only 1 deprecation message testing and we have added 3 deprecation messages. I think we should add testing for all of them.
Patch looks good.

daffie’s picture

Also 'needs work' for the fact that the testbot fails for PostgreSQL and SQLite.

mondrake’s picture

Status: Needs work » Needs review

All deprecations triggered should be covered by tests now.

daffie’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

The option 'throw_exception' has been deprecated.
Deprecation messages are being thrown and testing has been added.
All usage of the option has been removed without bracking BC.
The CR and the IS have been updated.
For me it is RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

This looks really close - just one bit of test that's being removed that I think should be converted to a legacy test. I've commented on the MR.

mondrake’s picture

Status: Needs work » Needs review

Thanks @alexpott, changes in the MR.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mondrake’s picture

Version: 9.3.x-dev » 9.2.x-dev

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

All points of @alexpott have been addressed.
Back to RTBC.

mondrake’s picture

Version: 9.3.x-dev » 9.2.x-dev
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 0bff06df0d to 9.3.x and d1461d6b53 to 9.2.x. Thanks!

alexpott’s picture

Issue summary: View changes

I think this is too low level to need a release note and highlighting on the release note. The change record should suffice.

  • alexpott committed 0bff06d on 9.3.x
    Issue #3189680 by mondrake, daffie, alexpott: Deprecate the '...

  • alexpott committed d1461d6 on 9.2.x
    Issue #3189680 by mondrake, daffie, alexpott: Deprecate the '...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.