Update NodeTypeInterface::get/setPreviewMode to use NodePreview enum

Created on 14 April 2025, 3 months ago

Problem/Motivation

Follow-up to 📌 Each class using DRUPAL_* constants from system.module should define its own constants Needs work

We will have an enum for NodePreview states which can be used in NodeTypeInterface::get/setPreviewMode

Proposed resolution

Not sure the best way to do this while maintaining BC, most likely:

- Add deprecated $returnAsInt param to getPreviewMode and update return type to int|NodePreview
- Update usages in core of getPreviewMode to expect NodePreview enum
- Allow int|NodePreview in setPreviewMode
- Update usages in core of setPreviewMode to use the NodePreview enum

Remaining tasks

Do it

API changes

NodeTypeInterface::getPreviewMode and NodeTypeInterface::setPreviewMode now interact with the NodePreview enum

Release notes snippet

📌 Task
Status

Postponed

Version

11.0 🔥

Component

node system

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