From fdc818f0b83a519e0a6a1dfa98a1fe98b6d15ac7 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 6 Nov 2016 16:37:13 +0100 Subject: [PATCH] More work-arounds for update from 2.1 --- com.woltlab.wcf/package.xml | 1 + com.woltlab.wcf/update.sql | 38 ------------------- com.woltlab.wcf/update_page.sql | 37 ++++++++++++++++++ .../application/ApplicationHandler.class.php | 3 ++ 4 files changed, 41 insertions(+), 38 deletions(-) create mode 100644 com.woltlab.wcf/update_page.sql diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 6bd2595b7c..82721a2bc0 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -54,6 +54,7 @@ files_pre_update.tar acp/update_com.woltlab.wcf_3.0_pre_sql.php + update_page.sql files.tar update.sql diff --git a/com.woltlab.wcf/update.sql b/com.woltlab.wcf/update.sql index c8f762b293..416de9b2f8 100644 --- a/com.woltlab.wcf/update.sql +++ b/com.woltlab.wcf/update.sql @@ -325,44 +325,6 @@ ALTER TABLE wcf1_package_update_version DROP COLUMN isCritical; DROP TABLE IF EXISTS wcf1_page_menu_item; -DROP TABLE IF EXISTS wcf1_page; -CREATE TABLE wcf1_page ( - pageID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, - parentPageID INT(10), - identifier VARCHAR(255) NOT NULL, - name VARCHAR(255) NOT NULL, - pageType VARCHAR(255) NOT NULL, - isDisabled TINYINT(1) NOT NULL DEFAULT 0, - isLandingPage TINYINT(1) NOT NULL DEFAULT 0, - isMultilingual TINYINT(1) NOT NULL DEFAULT 0, - originIsSystem TINYINT(1) NOT NULL DEFAULT 0, - packageID INT(10) NOT NULL, - applicationPackageID INT(10), - controller VARCHAR(255) NOT NULL DEFAULT '', - handler VARCHAR(255) NOT NULL DEFAULT '', - controllerCustomURL VARCHAR(255) NOT NULL DEFAULT '', - requireObjectID TINYINT(1) NOT NULL DEFAULT 0, - hasFixedParent TINYINT(1) NOT NULL DEFAULT 0, - lastUpdateTime INT(10) NOT NULL DEFAULT 0, - permissions TEXT NULL, - options TEXT NULL -); - -DROP TABLE IF EXISTS wcf1_page_content; -CREATE TABLE wcf1_page_content ( - pageContentID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, - pageID INT(10) NOT NULL, - languageID INT(10), - title VARCHAR(255) NOT NULL, - content MEDIUMTEXT, - metaDescription TEXT, - metaKeywords TEXT, - customURL VARCHAR(255) NOT NULL, - hasEmbeddedObjects TINYINT(1) NOT NULL DEFAULT 0, - - UNIQUE KEY (pageID, languageID) -); - ALTER TABLE wcf1_session DROP COLUMN controller; ALTER TABLE wcf1_session DROP COLUMN parentObjectType; ALTER TABLE wcf1_session DROP COLUMN parentObjectID; diff --git a/com.woltlab.wcf/update_page.sql b/com.woltlab.wcf/update_page.sql new file mode 100644 index 0000000000..4ddee5e241 --- /dev/null +++ b/com.woltlab.wcf/update_page.sql @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS wcf1_page; +CREATE TABLE wcf1_page ( + pageID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, + parentPageID INT(10), + identifier VARCHAR(255) NOT NULL, + name VARCHAR(255) NOT NULL, + pageType VARCHAR(255) NOT NULL, + isDisabled TINYINT(1) NOT NULL DEFAULT 0, + isLandingPage TINYINT(1) NOT NULL DEFAULT 0, + isMultilingual TINYINT(1) NOT NULL DEFAULT 0, + originIsSystem TINYINT(1) NOT NULL DEFAULT 0, + packageID INT(10) NOT NULL, + applicationPackageID INT(10), + controller VARCHAR(255) NOT NULL DEFAULT '', + handler VARCHAR(255) NOT NULL DEFAULT '', + controllerCustomURL VARCHAR(255) NOT NULL DEFAULT '', + requireObjectID TINYINT(1) NOT NULL DEFAULT 0, + hasFixedParent TINYINT(1) NOT NULL DEFAULT 0, + lastUpdateTime INT(10) NOT NULL DEFAULT 0, + permissions TEXT NULL, + options TEXT NULL +); + +DROP TABLE IF EXISTS wcf1_page_content; +CREATE TABLE wcf1_page_content ( + pageContentID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, + pageID INT(10) NOT NULL, + languageID INT(10), + title VARCHAR(255) NOT NULL, + content MEDIUMTEXT, + metaDescription TEXT, + metaKeywords TEXT, + customURL VARCHAR(255) NOT NULL, + hasEmbeddedObjects TINYINT(1) NOT NULL DEFAULT 0, + + UNIQUE KEY (pageID, languageID) +); diff --git a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php index 16b402b45e..4545da964d 100644 --- a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php +++ b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php @@ -66,6 +66,9 @@ class ApplicationHandler extends SingletonFactory { * @since 3.0 */ public function getApplicationByID($packageID) { + if ($packageID == 1 && !isset($this->cache['application'][1])) {// work-around for update from 2.1 (out-dated cache) + $this->cache['application'][1] = new Application(1); + } if (isset($this->cache['application'][$packageID])) { return $this->cache['application'][$packageID]; } -- 2.20.1