Use EntityReferenceRevisionsItem::class instead of the namespace in EntityReferenceRevisionsItem

Created on 20 November 2023, about 1 year ago

Problem/Motivation

Not sure why yet, but somehow our custom normalization tests fail after trying to move over from the EntityReferenceRevisionItemNormalizer in the entity_reference_revisions module to the normalizer provided by the hal module. It seems this is caused by the leading \ in the namespace provided
protected $supportedInterfaceOrClass = '\Drupal\entity_reference_revisions\Plugin\Field\FieldType\EntityReferenceRevisionsItem';

If the leading slash is removed, our custom tests pass again. Even better would be to just use EntityReferenceRevisionsItem::class, since that is also being done for other normalizers.

Proposed resolution

Change
protected $supportedInterfaceOrClass = '\Drupal\entity_reference_revisions\Plugin\Field\FieldType\EntityReferenceRevisionsItem';
to
protected $supportedInterfaceOrClass = EntityReferenceRevisionsItem::class;

Remaining tasks

User interface changes

-

API changes

-

Data model changes

-

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands seanB Netherlands

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

Comments & Activities

Production build 0.71.5 2024