Skip to content

Generics in 1.3.8 throw errors when using ->referencedEntities() #878

Closed
@acbramley

Description

@acbramley

Bug report

After updating to 1.3.8 I get the following error, downgrading to 1.3.7 fixes it:

Call to method id() on an unknown class Drupal\Core\Field\T

Code snippet that reproduces the problem

      foreach ($entity as $field) {
        if ($field instanceof EntityReferenceRevisionsFieldItemList) {
          $paragraphFields[] = $field;
        }
      }

      foreach ($paragraphFields as $field) {
        foreach ($field->referencedEntities() as $entity) {
          if ($entity instanceof SnswParagraphInterface) {
            yield (int) $entity->id() => $entity;

Where interface SnswParagraphInterface extends ParagraphInterface

Either caused by #847 or #869

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions