Deprecate events and hooks in 8.x-7.x

Created on 24 March 2024, 9 months ago
Updated 29 August 2024, 4 months ago

Problem/Motivation

Codebase on 8.0.x is changed. We need to deprecate some/all of the hooks and events.

Proposed resolution

Remaining tasks

- Make summary of all events and hooks that needs to be deprecated
- Create change record with code samples how changes should be done
- Add deprecations to 8.x-7.x codebase.

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

7.0

Component

Code

Created by

🇫🇮Finland sokru

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

Merge Requests

Comments & Activities

  • Issue created by @sokru
  • 🇨🇦Canada mparker17 UTC-4

    The changes to the code looks good to me thus far: all the hooks defined in elasticsearch_connector.api.php are deprecated, and the only module — elasticsearch_connector_views — has been marked as deprecated too.

    From experience, sometimes when I've written custom modules for a client site, I have used public methods from services defined in a contrib module. To this end, perhaps we should add the `deprecated:` key to the 4 services in elasticsearch_connector.services.yml?

    From experience, rarely when I've written custom modules for a client site, I have extended classes in a contrib module (usually base classes — but not always). To this end, perhaps we should consider adding a @deprecated annotation to the 58 classes that were deleted between 7.x and 8.x — you can get this list by running git diff --numstat --diff-filter=D 3433222-deprecations...8.0.x | grep .php? I daresay this is optional, because this is a lot of work, and extending classes aren't a recommended way to customize things.

    I notice there are some TODOs in the change record... would it be helpful for me to update the change record?

  • Status changed to Needs review 4 months ago
  • 🇫🇮Finland sokru

    @mparker17: I would greatly appreciate if you could update the change record.

    I added the deprecations for services, I think we should not add deprecations to classes, since its lot of work and it makes extra work to reroll any potential patches for 8.x-7.x branch.

    Wonder if there's any other deprecation we should (or could) add.

    The title and issue summary should be also updated to reflect what we have done.

  • 🇨🇦Canada mparker17 UTC-4

    @sokru, I spent some time updating the Change Record; but I still have work to do (I need to temporarily switch to other, more-pressing tasks today)

    I found the hook examples to be pretty long, so I split them into their own Change Records: https://www.drupal.org/node/3470987 and https://www.drupal.org/node/3471005 — but I think it is be worth keeping the original Change Record — https://www.drupal.org/node/3433223 — as a "summary". I think that it is likely that I will need to split out some of the sections for the events and services into their own change records too.

Production build 0.71.5 2024