From: ray176 Date: Tue, 13 Aug 2013 19:56:21 +0000 (+0200) Subject: Fix installation of other plugins when using versionable database objects X-Git-Tag: 2.0.0_Beta_7~18^2~5^2~1^2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed78700568a5774cc36f8e186a721bc0d0197191;p=GitHub%2FWoltLab%2FWCF.git Fix installation of other plugins when using versionable database objects --- diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 2c0e8a0370..852bd35cf7 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -1075,9 +1075,20 @@ class PackageInstallationDispatcher { )); } else { + $baseTableColumnNames = $versionTableColumnNames = $versionTableBaseColumnNames = array(); + foreach ($baseTableColumns as $column) { + $baseTableColumnNames[] = $column['name']; + } + foreach ($versionTableColumns as $column) { + $versionTableColumnNames[] = $column['name']; + } + foreach ($versionTableBaseColumns as $column) { + $versionTableBaseColumnNames[] = $column['name']; + } + // check garbage columns in versioned table foreach ($versionTableColumns as $columnData) { - if (!array_search($columnData['name'], $baseTableColumns, true)) { + if (!in_array($columnData['name'], $baseTableColumnNames) && !in_array($columnData['name'], $versionTableBaseColumnNames)) { // delete column WCF::getDB()->getEditor()->dropColumn(call_user_func(array($objectType->className, 'getDatabaseVersionTableName')), $columnData['name']); } @@ -1085,7 +1096,7 @@ class PackageInstallationDispatcher { // check new columns for versioned table foreach ($baseTableColumns as $columnData) { - if (!array_search($columnData['name'], $versionTableColumns, true)) { + if (!in_array($columnData['name'], $versionTableColumnNames)) { // add colum WCF::getDB()->getEditor()->addColumn(call_user_func(array($objectType->className, 'getDatabaseVersionTableName')), $columnData['name'], $columnData['data']); }