Skip to content

Commit d856e01

Browse files
committed
Fix translations collection detection for hierarchies with mapped superclasses
1 parent 1273914 commit d856e01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Doctrine/TranslatableClassMetadata.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,10 @@ private function findTranslatedProperties(ClassMetadata $cm, ClassMetadataFactor
232232
private function findTranslationsCollection(ClassMetadata $cm, ClassMetadataFactory $classMetadataFactory): void
233233
{
234234
foreach ($cm->associationMappings as $fieldName => $mapping) {
235-
if (isset($mapping['declared'])) {
236-
// The association is inherited from a parent class
235+
if (isset($mapping['inherited'])) {
236+
// "inherited" means that there is another (inheritance parent) entity class containing this
237+
// field (https://github.com/doctrine/orm/blob/580a95ce3f5f016547d15ecc6cc94dd85453bed5/src/Mapping/AssociationMapping.php#L34-L46).
238+
// Since PolyglotListener::getTranslationMetadatas() loops over these parent classes as well, we can skip the field here.
237239
continue;
238240
}
239241

0 commit comments

Comments
 (0)