Problem/Motivation

Currently, we do not have a strategy to provide a fallback alt for some entity types like paragraphs. That is because there are entities without a valid label, like paragraphs.

Steps to reproduce

  1. Configure default behavior as entity label
  2. Create a content type with a paragraphs field having an image.

Proposed resolution

For entities that support getting the parent entity, add a behavior to get parent entity label.

For example, for paragraphs it can be used the getParentEntity . For this specific use case, we need a bucle so we get a parent entity which is indeed supported. Example:

while ($parent instanceof ContentEntityInterface && $parent->getEntityTypeId() === 'paragraph') {
  $parent = $parent->getParentEntity();
}

Comments

omarlopesino created an issue.