Properly manage newly required parameter of FileUsageBase::__construct()

Created on 19 July 2019, over 5 years ago
Updated 15 September 2023, about 1 year ago

Problem/Motivation

Constructor has @deprecated tag and shouldn't.

it should trigger an error if the parameter is missing.
Additionally, DatabaseFileUsageBackend extends this class, and $config_factory is an optional third parameter in that class.

Proposed resolution

Remove @deprecated tag from FileUsageBase Constructor
Maintain the current BC layer and trigger an error if $config_factory is missing
Reorder the constructor arguments of DatabaseFileUsageBackend so that $config_factory is first and required.
Provide a BC layer if the arguments are passed in the old order and trigger an error.
Provide legacy tests to test the error triggering and that the BC layers work.
File a CR on the changing parameter order of DatabaseFileUsageBackend
File a follow-up against drupal 9 to restore type-hints and required status to parameters of both classes

Remaining tasks

review
commit

User interface changes

none

API changes

The signature of DatabaseFileUsageBackend has changed. A BC layer has been provided.

Data model changes

none

Release notes snippet

The constructor of DatabaseFileUsageBackend has had the order of its parameters changed.

πŸ“Œ Task
Status

Fixed

Version

8.8 ⚰️

Component
File systemΒ  β†’

Last updated about 10 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States mikelutz Michigan, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024