Skip to content

Commit 57d8fa3

Browse files
committed
Merge branch 'sw-25882/5.7/make-content-type-defs-public' into '5.7'
SW-25882 - Make content type definitons public See merge request shopware/5/product/shopware!549
2 parents 693395e + 8afd8b4 commit 57d8fa3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterDynamicController.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function process(ContainerBuilder $container): void
5252
'module' => 'backend',
5353
]
5454
);
55+
$backendController->setPublic(true);
5556

5657
$container->setDefinition('shopware_bundle.content_type.controllers.backend.' . $name, $backendController);
5758

@@ -69,25 +70,28 @@ public function process(ContainerBuilder $container): void
6970
'module' => 'api',
7071
]
7172
);
73+
$apiController->setPublic(true);
7274

7375
$container->setDefinition('shopware_bundle.content_type.controllers.api.' . $name, $apiController);
7476

7577
if ($this->allFrontendRequirementsMet($type)) {
76-
$apiController = new Definition(\Shopware\Bundle\ContentTypeBundle\Controller\Frontend\ContentType::class);
77-
$apiController->setArguments([
78+
$frontendController = new Definition(\Shopware\Bundle\ContentTypeBundle\Controller\Frontend\ContentType::class);
79+
$frontendController->setArguments([
7880
new Reference('shopware.bundle.content_type.' . $name),
7981
new Expression('service("Shopware\\\\Bundle\\\\ContentTypeBundle\\\\Services\\\\FrontendTypeTranslatorInterface").translate(service("Shopware\\\\Bundle\\\\ContentTypeBundle\\\\Services\\\\TypeProvider").getType("' . $name . '"))'),
8082
]);
8183

82-
$apiController->addTag(
84+
$frontendController->addTag(
8385
'shopware.controller',
8486
[
8587
'controller' => 'Custom' . ucfirst($name),
8688
'module' => 'frontend',
8789
]
8890
);
8991

90-
$container->setDefinition('shopware_bundle.content_type.controllers.frontend.' . $name, $apiController);
92+
$frontendController->setPublic(true);
93+
94+
$container->setDefinition('shopware_bundle.content_type.controllers.frontend.' . $name, $frontendController);
9195
}
9296
}
9397
}

engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterTypeRepositories.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public function process(ContainerBuilder $container): void
4747
new Reference(TypeFieldResolver::class),
4848
]);
4949

50+
$def->setPublic(true);
51+
5052
$container->setDefinition('shopware.bundle.content_type.' . $name, $def);
5153
}
5254
}

0 commit comments

Comments
 (0)