Update class deprecations to implement "Concrete, instantiated classes" policy

Created on 23 January 2023, almost 2 years ago
Updated 4 July 2023, over 1 year ago

Problem/Motivation

This is a followup to πŸ“Œ [policy, then docs] Change how we deprecate classes Fixed .

The deprecation policy for classes β†’ now include a specific policy for concrete classes β†’ . All existing class deprecations in core need to be updated to the new policy.

This may not find all of the ones that need to change, but it is a start.
git grep "@trigger_error(" | grep NAMESPACE | awk -F: '{print $1}' | sort -u | nl

Steps to reproduce

$  git grep "@trigger_error(" | grep NAMESPACE | awk -F: '{print $1}' | sort -u | nl
     1  core/lib/Drupal/Component/Plugin/PluginHelper.php
     2  core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
     3  core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
     4  core/lib/Drupal/Core/Http/RequestStack.php
     5  core/modules/system/tests/modules/deprecation_test/src/Deprecation/DrupalStandardsListenerDeprecatedClass.php
     6  core/modules/system/tests/modules/deprecation_test/src/Deprecation/FixtureDeprecatedClass.php

Proposed resolution

Convert existing class deprecations to use the new policy.

Remaining tasks

Patch
Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
OtherΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡³πŸ‡ΏNew Zealand quietone

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.

  • Issue created by @quietone
  • πŸ‡³πŸ‡±Netherlands spokje
  • First commit to issue fork.
  • last update over 1 year ago
    29,559 pass
  • @lucienchalom opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡§πŸ‡·Brazil lucienchalom

    I moved the deprecation error triger in classes:
    3 core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
    2 core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php

    and deleted the redundant trigger from
    4 core/lib/Drupal/Core/Http/RequestStack.php

    I am not really sure how to proceed with
    5 core/modules/system/tests/modules/deprecation_test/src/Deprecation/DrupalStandardsListenerDeprecatedClass.php
    6 core/modules/system/tests/modules/deprecation_test/src/Deprecation/FixtureDeprecatedClass.php
    because they are "arbitrarily deprecated in order to test the deprecation error handling properties of DrupalStandardsListener."

    and
    1 core/lib/Drupal/Component/Plugin/PluginHelper.php
    does not accept a contruct.

    I tried to look for other classes deprecated but could not find any concrete, instantiated classes.

    please help and review

  • Status changed to RTBC over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    I think this is good but not sure the policy for moving existing deprecation triggers.

  • last update over 1 year ago
    29,567 pass
  • last update over 1 year ago
    29,571 pass
  • last update over 1 year ago
    29,801 pass
  • Status changed to Needs work over 1 year ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @lucienchalom, thanks for working on this! This is a good start. For PluginHelper and RequestStack add a constructor (stated in policy) and then the test will need to be changed to instantiate the class. And the same for the test modules because we should be using the standard set in policy and well as testing that.

    @smustgrave, There is no policy for moving deprecations. There is a policy for concrete classes and core needs to change to met the current standard.

    The issue summary has a sample grep to find the instances that need to be changed. Has anyone worked to improve on that or verify that it is accurate?

Production build 0.71.5 2024