Problem/Motivation

The docblock on the Drupal\content_moderation\Entity\Handler\ModerationHandler is a bit confusing. It claims "this class is intended primarily as a base class" and in the same breath is tagged @internal.

Both BlockContentModerationHandler and NodeModerationHandler extend it already, so why can't contributed modules? It would seem reasonable to use this as a base class for custom entities. Otherwise, developers will just copy/paste the whole class into their own, and we lose one of the core benefits of OOP.

Steps to reproduce

Code inspection. Check out the docblock at core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php:14.

Proposed resolution

Remove the @internal tag from the ModerationHandler class.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Comments

John Franklin created an issue. See original summary.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

This came up as a daily BSI target

Wasn't sure so posted in #core-development in slack

From @godotislate

@internal doesn't mean "can't use", it means "no BC support"

and the interface

**
 * Defines operations that need to vary by entity type.
 *
 * Much of the logic contained in this handler is an indication of flaws
 * in the Entity API that are insufficiently standardized between entity types.
 * Hopefully over time functionality can be removed from this interface.
 *
 * @internal
 */
interface ModerationHandlerInterface {

So believe this is a works as designed. Recommend we close this.

quietone’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Fixed

@John Franklin, How Drupal core uses the @internal tag is explained in API definition section of the BC policy. In part, it states,

Internal APIs
Contributed and custom code should avoid calling internal APIs because they might change in minor releases and such changes may not be documented in change records.

That and the previous comment resolve the question. There is no bug here, and the documentation exists, I am changing this to a support request. Also, closing because it has been answered.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.