From d5b28fbee926c6f2d29f5a7be76cd593df25178e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 24 Dec 2016 13:38:54 +0100 Subject: [PATCH] Added missing wcf1_application updates --- com.woltlab.wcf/package.xml | 21 +++++----- com.woltlab.wcf/update_1.sql | 1 + com.woltlab.wcf/update_3.0.0_rc_2.sql | 5 --- com.woltlab.wcf/update_5.sql | 5 +++ .../acp/update_com.woltlab.wcf_3.0.0_rc_1.php | 39 ------------------- .../acp/update_com.woltlab.wcf_3.0.0_rc_3.php | 28 +++++++++++++ .../install/files/lib/system/WCF.class.php | 3 +- 7 files changed, 44 insertions(+), 58 deletions(-) delete mode 100644 com.woltlab.wcf/update_3.0.0_rc_2.sql delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_1.php create mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_3.php diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 3fcaf23407..abc2e7fc9a 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -5,8 +5,8 @@ Free CMS and web-framework, designed for awesome websites and communities. Freies CMS und Web-Framework, das eindrucksvolle Websites und Communities ermöglicht. 1 - 3.0.0 RC 2 - 2016-12-21 + 3.0.0 RC 3 + 2016-12-21 @@ -88,18 +88,15 @@ acp/update_com.woltlab.wcf_3.0_post_sql.php - - - + + files_update.tar - update_3.0.0_rc_2.sql - - - language/*.xml + + + + acp/update_com.woltlab.wcf_3.0.0_rc_3.php - templates_update.tar - - + diff --git a/com.woltlab.wcf/update_1.sql b/com.woltlab.wcf/update_1.sql index e09b2b897c..e920ff8af9 100644 --- a/com.woltlab.wcf/update_1.sql +++ b/com.woltlab.wcf/update_1.sql @@ -25,6 +25,7 @@ ALTER TABLE wcf1_acp_session DROP COLUMN objectID; ALTER TABLE wcf1_application DROP COLUMN cookiePath; ALTER TABLE wcf1_application DROP COLUMN isPrimary; ALTER TABLE wcf1_application ADD isTainted TINYINT(1) NOT NULL DEFAULT 0; +ALTER TABLE wcf1_application ADD landingPageID INT(10) NULL; DROP TABLE IF EXISTS wcf1_article; CREATE TABLE wcf1_article ( diff --git a/com.woltlab.wcf/update_3.0.0_rc_2.sql b/com.woltlab.wcf/update_3.0.0_rc_2.sql deleted file mode 100644 index f3c5383483..0000000000 --- a/com.woltlab.wcf/update_3.0.0_rc_2.sql +++ /dev/null @@ -1,5 +0,0 @@ -/* 495a4c11a530a91c4d3320124752d4157ac48ec7 */ -ALTER TABLE wcf1_application ADD COLUMN landingPageID INT(10) NULL; -ALTER TABLE wcf1_application ADD FOREIGN KEY (landingPageID) REFERENCES wcf1_page (pageID) ON DELETE SET NULL; - -UPDATE wcf1_application SET landingPageID = (SELECT pageID FROM wcf1_page WHERE isLandingPage = 1 LIMIT 1) WHERE packageID = 1; diff --git a/com.woltlab.wcf/update_5.sql b/com.woltlab.wcf/update_5.sql index 8c4c2c2a59..4beb41b86d 100644 --- a/com.woltlab.wcf/update_5.sql +++ b/com.woltlab.wcf/update_5.sql @@ -7,6 +7,8 @@ ALTER TABLE wcf1_acl_simple_to_group ADD FOREIGN KEY (groupID) REFERENCES wcf1_u ALTER TABLE wcf1_acp_session_virtual ADD FOREIGN KEY (sessionID) REFERENCES wcf1_acp_session (sessionID) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE wcf1_application ADD FOREIGN KEY (landingPageID) REFERENCES wcf1_page (pageID) ON DELETE SET NULL; + ALTER TABLE wcf1_article ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE SET NULL; ALTER TABLE wcf1_article ADD FOREIGN KEY (categoryID) REFERENCES wcf1_category (categoryID) ON DELETE SET NULL; @@ -207,3 +209,6 @@ INSERT INTO wcf1_template_group (parentTemplateGroupID, templateGroupName, templ INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('YouTube Playlist', 'https?://(?:.+?\\.)?youtu(?:\\.be/|be\\.com/)playlist\\?(?:.*?&)?list=(?P[a-zA-Z0-9_-]+)', '
'); UPDATE wcf1_bbcode_media_provider SET regex = 'https?://vimeo\\.com/(?:channels/[^/]+/)?(?P\\d+)' WHERE title = 'Vimeo'; UPDATE wcf1_bbcode_media_provider SET regex = 'https?://(?:www\\.)?dailymotion\\.com/video/(?P[a-zA-Z0-9_-]+)', html = '' WHERE title = 'DailyMotion'; + +-- application landing page +UPDATE wcf1_application SET landingPageID = (SELECT pageID FROM wcf1_page WHERE isLandingPage = 1 LIMIT 1) WHERE packageID = 1; diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_1.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_1.php deleted file mode 100644 index bed35a8e64..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_1.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @package WoltLabSuite\Core - */ -$sessionID = SessionHandler::getInstance()->sessionID; - -SessionHandler::getInstance()->disableUpdate(); - -$sql = "SELECT * - FROM wcf".WCF_N."_acp_session_virtual - WHERE sessionID = ?"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute([$sessionID]); -$sessionVariables = ''; -while ($row = $statement->fetchArray()) { - $tmp = @unserialize($row['sessionVariables']); - if ($tmp['__SECURITY_TOKEN'] == SECURITY_TOKEN) { - $sessionVariables = $row['sessionVariables']; - } -} - -$sql = "UPDATE wcf".WCF_N."_acp_session - SET sessionVariables = ? - WHERE sessionID = ?"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute([ - $sessionVariables, - $sessionID -]); - -$statement = WCF::getDB()->prepareStatement("ALTER TABLE wcf".WCF_N."_acp_session_virtual DROP COLUMN sessionVariables"); -$statement->execute(); - diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_3.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_3.php new file mode 100644 index 0000000000..7385b3aef4 --- /dev/null +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_3.php @@ -0,0 +1,28 @@ + + * @package WoltLabSuite\Core + */ +$columns = WCF::getDB()->getEditor()->getColumns("wcf".WCF_N."_application"); +$hasLandingPageID = false; +foreach ($columns as $column) { + if ($column['name'] == 'landingPageID') { + $hasLandingPageID = true; + break; + } +} + +if (!$hasLandingPageID) { + $statement = WCF::getDB()->prepareStatement("ALTER TABLE wcf".WCF_N."_application ADD COLUMN landingPageID INT(10) NULL"); + $statement->execute(); + + $statement = WCF::getDB()->prepareStatement("ALTER TABLE wcf".WCF_N."_application ADD CONSTRAINT `8a7fc72db2348bc5695394ffd616cbf5_fk` FOREIGN KEY (landingPageID) REFERENCES wcf".WCF_N."_page (pageID) ON DELETE SET NULL;"); + $statement->execute(); + + $statement = WCF::getDB()->prepareStatement("UPDATE wcf".WCF_N."_application SET landingPageID = (SELECT pageID FROM wcf".WCF_N."_page WHERE isLandingPage = 1 LIMIT 1) WHERE packageID = 1;"); + $statement->execute(); +} diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 1c9b617b3f..21a7578da7 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -27,7 +27,6 @@ use wcf\system\language\LanguageFactory; use wcf\system\package\PackageInstallationDispatcher; use wcf\system\request\Request; use wcf\system\request\RequestHandler; -use wcf\system\request\RouteHandler; use wcf\system\session\SessionFactory; use wcf\system\session\SessionHandler; use wcf\system\style\StyleHandler; @@ -47,7 +46,7 @@ if (!@ini_get('date.timezone')) { } // define current woltlab suite version -define('WCF_VERSION', '3.0.0 RC 2'); +define('WCF_VERSION', '3.0.0 RC 3'); // define current unix timestamp define('TIME_NOW', time()); -- 2.20.1