Create enum for FilterInterface:TYPE_* constants

Created on 29 February 2024, about 1 year ago
Updated 10 March 2024, 12 months ago

Problem/Motivation

\Drupal\filter\Plugin\FilterInterface declares constants for each of the following filter types: TYPE_MARKUP_LANGUAGE, TYPE_HTML_RESTRICTOR, TYPE_TRANSFORM_REVERSIBLE, TYPE_TRANSFORM_IRREVERSIBLE. They happen to be integers because constants need a value, but since they are never serialized or written to a database we don't need them to be backed, except probably for BC.

Steps to reproduce

Proposed resolution

  • Create a new enum FilterType with cases for MarkupLanguage, HtmlRestrictor, TransformReversible and TransformIrreversible.
  • Update references to these constants to get the enum instead
  • Add BC layer to find these by their former integer value
  • Remove integer backing in a later version

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Filter  →

Last updated 4 days ago

No maintainer
Created by

🇦🇺Australia mstrelan

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024