Entity handler annotations should consistently use a leading slash, or not

Created on 11 July 2016, almost 8 years ago
Updated 30 January 2023, over 1 year ago

Problem/Motivation

In the annotation for the EntityTestWithBundle content entity in the entity_test module (which is a submodule of system), the class declarations for forms include a leading backslash in the class names. However, when form objects are loaded and their classes are checked with get_class(), the leading backslash is not part of the class name. Any automated tests that rely on a comparison of the class name from the annotation with the class name of the object will fail as a result.

Proposed resolution

Attaching a patch that includes a test only (to demonstrate the failing condition) and a patch with both the test and the code correction.

Remaining tasks

Needs community review.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ“Œ Task
Status

Needs work

Version

10.1 ✨

Component
SystemΒ  β†’

Last updated 2 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States danmuzyka

Live updates comments and jobs are added and updated live.
  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot β†’ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

Production build 0.69.0 2024