Fix handling of standalone instruction attribute in DevTools
authorMatthias Schmidt <gravatronics@live.com>
Mon, 26 Apr 2021 14:32:07 +0000 (16:32 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 26 Apr 2021 14:32:07 +0000 (16:32 +0200)
ts/WoltLabSuite/Core/Acp/Form/Builder/Field/Devtools/Project/Instructions.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Form/Builder/Field/Devtools/Project/Instructions.js
wcfsetup/install/files/lib/system/devtools/package/DevtoolsPackageXmlWriter.class.php

index 2c4f36975ea3831be7aafd96b4cbf9be2227e5f0..417a5e98e2f895e4cf1da791360d9fde7c8dca96 100644 (file)
@@ -187,7 +187,7 @@ class Instructions {
     listItem.dataset.instructionId = instructionId.toString();
     listItem.dataset.application = instructionData.application;
     listItem.dataset.pip = instructionData.pip;
-    listItem.dataset.runStandalone = instructionData.runStandalone ? "true" : "false";
+    listItem.dataset.runStandalone = instructionData.runStandalone ? "1" : "0";
     listItem.dataset.value = instructionData.value;
 
     let content = `
index 044d0af3172e2249bad5b5b088a36c247a74d104..74376620664ed4a3c36a1790edd7936ec9a9a1a6 100644 (file)
@@ -106,7 +106,7 @@ define(["require", "exports", "tslib", "../../../../../../Core", "../../../../..
             listItem.dataset.instructionId = instructionId.toString();
             listItem.dataset.application = instructionData.application;
             listItem.dataset.pip = instructionData.pip;
-            listItem.dataset.runStandalone = instructionData.runStandalone ? "true" : "false";
+            listItem.dataset.runStandalone = instructionData.runStandalone ? "1" : "0";
             listItem.dataset.value = instructionData.value;
             let content = `
       <div class="sortableNodeLabel">
index 69bf84c6378a2e0e53d6955ce6cce8ecfcc61209..4360c2763d5260ade930d27ae934505f048e4599 100644 (file)
@@ -173,7 +173,7 @@ class DevtoolsPackageXmlWriter
 
             foreach ($instructions['instructions'] as $instruction) {
                 $attributes = ['type' => $instruction['pip']];
-                if (!empty($instruction['runStandalone'])) {
+                if (!isset($instruction['runStandalone']) && $instruction['runStandalone'] !== "0") {
                     $attributes['run'] = 'standalone';
                 }
                 if (!empty($instruction['application'])) {
@@ -248,7 +248,7 @@ class DevtoolsPackageXmlWriter
                     );
                 }
             }
-        } else if (
+        } elseif (
             isset($this->packageXmlData[$information])
             && $this->packageXmlData[$information] !== ""
         ) {