Replace comment constants with enums

Created on 14 April 2025, about 2 months ago

Problem/Motivation

Comment module introduced various constants in 2005 when enums in php didn't exist. See #21221: Make status values in comment.module defined constants for readability and #34295: comment configure bug (Default display mode and Comment controls) for example.

Steps to reproduce

Proposed resolution

CommentInterface - NOT_PUBLISHED and PUBLISHED moves to a CommentStatus enum with cases Published and NotPublished.

CommentInterface - ANONYMOUS_MAYNOT_CONTACT, ANONYMOUS_MAY_CONTACT and ANONYMOUS_MUST_CONTACT moves to a AnonymousContact enum with cases MayNot, May and Must.

CommentItemInterface - HIDDEN, CLOSED and OPEN moves to a DisplaySettings enum with cases Hidden, Closed and Open.

CommentItemInterface - FORM_SEPARATE_PAGE and FORM_BELOW moves to a FormSettings enum with cases Page and Below.

CommentManagerInterface - COMMENT_MODE_FLAT and COMMENT_MODE_THREADED moves to a CommentMode enum with cases Flat and Threaded.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

comment.module

Created by

🇦🇺Australia mstrelan

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

Merge Requests

Comments & Activities

  • Issue created by @mstrelan
  • Merge request !11816Draft: CommentStatus enum → (Open) created by mstrelan
  • Pipeline finished with Failed
    about 2 months ago
    Total: 208s
    #472761
  • Pipeline finished with Failed
    about 2 months ago
    Total: 410s
    #472765
  • 🇦🇺Australia mstrelan

    We'll probably need to split this in to 5 separate issues, but adding all to one MR for now.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 129s
    #472772
  • Pipeline finished with Failed
    about 2 months ago
    Total: 484s
    #472774
  • Pipeline finished with Failed
    about 2 months ago
    Total: 234s
    #472792
  • Pipeline finished with Failed
    about 2 months ago
    Total: 119s
    #473540
  • Pipeline finished with Failed
    about 2 months ago
    Total: 520s
    #473590
  • Pipeline finished with Failed
    about 2 months ago
    Total: 480s
    #473615
  • Pipeline finished with Success
    about 2 months ago
    Total: 453s
    #473629
Production build 0.71.5 2024