Skip to content

Commit 87c4f4d

Browse files
committed
Fix ComponentGroup not linked to Layout/Page in CwaFixtureBuilder
addLayout()/addPage() are on the inverse side of the ManyToMany — Doctrine ignores inverse-side changes when writing join tables. Must add via the owning-side collection: owner->getComponentGroups()->add(group).
1 parent 89cd728 commit 87c4f4d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/Fixture/CwaFixtureBuilder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,10 @@ private function phaseTwo(): void
310310

311311
if ($owner instanceof Layout) {
312312
$componentGroup->reference = \sprintf('layout:%s/%s', $owner->reference, $groupBuilder->getName());
313-
$componentGroup->addLayout($owner);
314313
} else {
315314
$componentGroup->reference = \sprintf('page:%s/%s', $owner->reference ?? $owner->getTitle(), $groupBuilder->getName());
316-
$componentGroup->addPage($owner);
317315
}
316+
$owner->getComponentGroups()->add($componentGroup);
318317

319318
foreach ($groupBuilder->getAllowedClasses() as $class) {
320319
$componentGroup->addAllowedComponent(

0 commit comments

Comments
 (0)