From: Marcel Werk Date: Sun, 6 Nov 2016 15:37:13 +0000 (+0100) Subject: More work-arounds for update from 2.1 X-Git-Tag: 3.0.0_Beta_5~66^2~11 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fdc818f0b83a519e0a6a1dfa98a1fe98b6d15ac7;p=GitHub%2FWoltLab%2FWCF.git More work-arounds for update from 2.1 --- 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]; }