Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

BLT-5231: Update assertion handling to remove use of deprecated class #4726

@tomdearden

Description

@tomdearden

Is your feature request related to a problem? Please describe.
When using the latest version of BLT with Drupal >10.1 I get the following deprecation notice when visiting install.php:

The \Drupal\Component\Assertion\Handle is deprecated in Drupal 10.1.0 and will be removed from Drupal 11.0.0. Instead, replace the calls to \Drupal\Component\Assertion\Handle::register() method with assert_options(ASSERT_EXCEPTION, TRUE).

This seems to break the install process as well, once the batch UI shows up - I think the notice maybe causes the AJAX call to fail?

Describe the solution you'd like
I'd like to see the default assertion handling in settings/default.local.settings.php changed from:

Handle::register();

to

assert_options(ASSERT_EXCEPTION, TRUE);

and the associated use statement removed from the top of the file.

Describe alternatives you've considered
I can manually edit the generated file every time I create a new D10 project.

Additional context
See here for the Drupal change request - https://www.drupal.org/node/3105918

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementA feature or feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions