Skip to content

Commit

Permalink
Merge branch 'bp-6.6.0.0-2b61ab7' into '6.6.0.0'
Browse files Browse the repository at this point in the history
[6.6.0.0] NEXT-34448 - Fix error for app theme that depends only on Storefront

See merge request shopware/6/product/platform!13392
  • Loading branch information
philipreinken committed Mar 20, 2024
2 parents 99eccb1 + 1bddc71 commit b0ae9ef
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Storefront/Theme/ThemeCompiler.php
Expand Up @@ -208,6 +208,11 @@ private function getScriptDistFolders(StorefrontPluginConfigurationCollection $c
$scriptsDistFolders = [];
foreach ($configurationCollection as $configuration) {
$scripts = $configuration->getScriptFiles();
foreach ($scripts as $key => $script) {
if ($script->getFilepath() === '@Storefront') {
$scripts->remove($key);
}
}
if ($scripts->count() === 0) {
continue;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/Storefront/Theme/ThemeCompilerTest.php
Expand Up @@ -732,6 +732,7 @@ public function testCopyScriptFilesToTheme(): void

$appWrongPath = $projectDir . '/tmp/207973030/1_0_0/Resources'; // missing ThemeApp in path
$app->setBasePath($appWrongPath);
$appWithoutJs = $configurationFactory->createFromApp('ThemeAppWithoutJs', 'ThemeAppWithoutJs');

$notFoundPlugin = $configurationFactory->createFromBundle($notFoundPluginBundle);
$scripts = new FileCollection();
Expand All @@ -745,6 +746,7 @@ public function testCopyScriptFilesToTheme(): void
$configCollection->add($asyncPlugin);
$configCollection->add($notFoundPlugin);
$configCollection->add($app);
$configCollection->add($appWithoutJs);

$compiler->compileTheme(
TestDefaults::SALES_CHANNEL,
Expand Down
@@ -0,0 +1,20 @@
{
"name": "ThemeApp",
"author": "Shopware AG",
"views": [
"@Storefront",
"@Plugins",
"@TestTheme"
],
"style": [
"app/storefront/src/scss/overrides.scss",
"@Storefront",
"app/storefront/src/scss/base.scss"
],
"script": [
"@Storefront"
],
"asset": [
"app/storefront/src/assets"
]
}
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/trunk/src/Core/Framework/App/Manifest/Schema/manifest-2.0.xsd">
<meta>
<name>SwagApp</name>
<label>Swag App Test</label>
<label lang="de-DE">Swag App Test</label>
<description>Test for App System</description>
<description lang="de-DE">Test für das App System</description>
<author>shopware AG</author>
<copyright>(c) by shopware AG</copyright>
<version>1.0.0</version>
<icon>icon.png</icon>
<license>MIT</license>
</meta>
<setup>
<registrationUrl>https://my.app.com/SwagApp/registration</registrationUrl>
<secret>s3cr3t</secret>
</setup>
<admin>
<action-button
action="viewOrder"
entity="order"
view="detail"
url="https://swag-test.com/your-order">
<label>View Order</label>
<label lang="de-DE">Zeige Bestellung</label>
</action-button>
<action-button
action="doStuffWithProducts"
entity="product"
view="list"
url="https://swag-test.com/do-stuff">
<label>Do Stuff</label>
</action-button>
<module name="first-module" source="https://test.com" parent="sw-catalouge">
<label>My first own module</label>
<label lang="de-DE">Mein erstes eigenes Modul</label>
</module>
</admin>
<permissions>
<create>product</create>
<update>product</update>
<delete>product</delete>
<delete>category</delete>
<create>product_manufacturer</create>
<delete>product_manufacturer</delete>
<create>tax</create>
<read>order</read>
</permissions>
<custom-fields>
<custom-field-set>
<name>custom_field_test</name>
<label>Custom field test</label>
<label lang="de-DE">Zusatzfeld Test</label>
<related-entities>
<product/>
<customer/>
</related-entities>
<fields/>
</custom-field-set>
</custom-fields>
<webhooks>
<webhook name="hook1" url="https://test.com/hook" event="checkout.customer.before.login"/>
<webhook name="hook2" url="https://test.com/hook2" event="checkout.order.placed"/>
</webhooks>
</manifest>

0 comments on commit b0ae9ef

Please sign in to comment.