Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In example.settings.local.php
we recommend using \Drupal\Component\Assertion\Handle::register()
for assertions.
Since we're working on deprecating/removing this method in #3054072: Deprecate \Drupal\Component\Assertion\Handle::register(), we should change this recommendation.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Drupal\Component\Assertion\Handle
will be deprecated in a future release. For this reason, example.settings.local.php
has been updated to change the default assertion handling from:
assert_options(ASSERT_ACTIVE, TRUE);
\Drupal\Component\Assertion\Handle::register();
to:
assert_options(ASSERT_ACTIVE, TRUE);
assert_options(ASSERT_EXCEPTION, TRUE);
Site owners using settings.local.php
for development sites may wish to update their workflow with this change.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3295650-2.patch | 962 bytes | Spokje |
|
Comments
Comment #2
SpokjeComment #3
catchLooks great. The rest of that issue is tricky, but this feels like something to get in as soon as possible to minimise the number of installs using the class.
Comment #4
SpokjeComment #11
xjmI'm surprised the docblock above this doesn't need an update. I checked what it says:
Some of that is out of date, but not in a way that pertains to the code.
Adding some credits from the other issue.
Comment #14
xjmCommitted to 10.1.x and cherry-picked to 10.0.x and 9.5.x.
I wasn't sure about backporting this to 9.4.x. Since it changes default patterns for site-owner managed files (in this case,
local.settings.php
we have to explain the addition/change in a release note). The backport wouldn't affect existing sites -- only new or reinstalled ones that copy over the newexample.settings.local.php
-- so in that sense it's non-disruptive.I think it's probably okay to backport; we would just need the release note a little sooner then (and to adjust the issue tags accordingly).
Leaving at PTBP to discuss one way or another and to add the release note (which is needed either way).
Comment #15
longwaveSeems this didn't make it to 9.5.x.
I am not sure this is worth the backport to 9.4.x, it's hardly critical and we don't usually make these kinds of changes in patch releases.
Comment #17
xjmMust've had a failed push.
Added a release note.
Comment #19
catch