Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If a relationship brings no entity (because it has no editable fields, and is not required), then the $entity variable persists across the foreach loop. You then get an entity of type A stashed in the array under the next type in the loop!!!
Comments
Comment #1
joachim CreditAttribution: joachim commented