Add CommentPreview enum and replace usage of DRUPAL_DISABLED, DRUPAL_OPTIONAL and DRUPAL_REQUIRED

Created on 29 July 2025, 17 days ago

Problem/Motivation

Part of πŸ“Œ Each class using DRUPAL_* constants from system.module should define its own constants Needs work - we want to deprecate DRUPAL_DISABLED, DRUPAL_OPTIONAL and DRUPAL_REQUIRED. Doing this in a single issue is too hard to review and we want to change the API as we go.

This ticket is for the Comment module.

Proposed resolution

- Add CommentPreview enum
- Replace usages of constants with new enum
- Update $mode param to take CommentPreview
- $message is unused by setCommentSettings so we can remove $mode_text entirely. We can used named params to continue to pass $field_name.
- Pass $mode->value into setCommentSettings

API changes

CommentTestBase::setCommentPreview now takes a CommentPreview object instead of int for $mode

Release notes snippet

N/A

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

comment.module

Created by

πŸ‡¦πŸ‡ΊAustralia acbramley

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

Comments & Activities

Production build 0.71.5 2024