Add cleanup script to clean invalid excluded versions
authorjoshuaruesweg <ruesweg@woltlab.com>
Mon, 21 Mar 2022 13:06:44 +0000 (14:06 +0100)
committerjoshuaruesweg <ruesweg@woltlab.com>
Mon, 21 Mar 2022 13:23:41 +0000 (14:23 +0100)
com.woltlab.wcf/package.xml
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_cleanupPackageExclusion.php [new file with mode: 0644]

index ea78fba0a782a2a249477bacf147baa6324ac388..96d29c0b781ae7f3e86521342e421315045ab98f 100644 (file)
@@ -8,20 +8,20 @@
                <version>5.5.0 Alpha 1</version>
                <date>2022-02-15</date>
        </packageinformation>
-       
+
        <authorinformation>
                <author>WoltLab GmbH</author>
                <authorurl>https://www.woltlab.com</authorurl>
        </authorinformation>
-       
+
        <instructions type="install">
                <instruction type="packageInstallationPlugin" />
                <instruction type="acpMenu" />
                <instruction type="userGroupOption" />
                <instruction type="option" />
-               
+
                <instruction type="template" run="standalone" />
-               
+
                <instruction type="eventListener" />
                <instruction type="script">acp/install.php</instruction>
                <instruction type="cronjob" />
@@ -31,9 +31,9 @@
                <instruction type="objectType" />
                <instruction type="acpSearchProvider" />
                <instruction type="style">defaultStyle.tar</instruction>
-               
+
                <instruction type="userOption" run="standalone" />
-               
+
                <instruction type="bbcode" />
                <instruction type="smiley" />
                <instruction type="userProfileMenu" />
@@ -46,7 +46,7 @@
                <instruction type="box" />
                <instruction type="mediaProvider" />
                <instruction type="templateListener" />
-               
+
                <instruction type="script">acp/post_install.php</instruction>
        </instructions>
 
@@ -101,6 +101,7 @@ tar cvf com.woltlab.wcf/files_pre_check.tar -C wcfsetup/install/files/ \
                <instruction type="fileDelete" />
                <instruction type="templateDelete" />
                <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.5_clearPackageDeprecations.php</instruction>
+               <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.5_cleanupPackageExclusion.php</instruction>
 
                <!-- Misc. Update Scripts. -->
                <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.5_randomize_cronjobs.php</instruction>
diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_cleanupPackageExclusion.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_cleanupPackageExclusion.php
new file mode 100644 (file)
index 0000000..e12d961
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Since version 5.5 the excluded package version must be explicit set. If not, the installation of the plugin in denied.
+ * For this reason, the (unused) format is rewritten from empty to `*`.
+ *
+ * see https://github.com/WoltLab/WCF/pull/4492
+ *
+ * @author Joshua Ruesweg
+ * @copyright 2001-2022 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core
+ */
+
+use wcf\system\WCF;
+
+$sql = "UPDATE  wcf1_package_exclusion
+        SET     excludedPackageVersion = ?
+        WHERE   excludedPackageVersion = ?";
+$statement = WCF::getDB()->prepare($sql);
+$statement->execute([
+    '*',
+    '',
+]);