Skip to content

Commit

Permalink
Fix an error in UpgradeHandler for fresh installs.
Browse files Browse the repository at this point in the history
  • Loading branch information
discordier committed Oct 21, 2014
1 parent 5773f19 commit d37da60
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/MetaModels/Helper/UpgradeHandler.php
Expand Up @@ -83,7 +83,9 @@ protected static function upgradeJumpTo()
protected static function upgradeDcaSettingsPublished()
{
$objDB = self::DB();
if (!$objDB->fieldExists('published', 'tl_metamodel_dcasetting', true)) {
if (!($objDB->tableExists('tl_metamodel_dcasetting', null, true)
&& $objDB->fieldExists('published', 'tl_metamodel_dcasetting', true))
) {
// Create the column in the database and copy the data over.
TableManipulation::createColumn(
'tl_metamodel_dcasetting',
Expand Down Expand Up @@ -123,7 +125,9 @@ protected static function changeSubPalettesToConditions()
);
}

if ($objDB->fieldExists('subpalette', 'tl_metamodel_dcasetting', true)) {
if (!($objDB->tableExists('tl_metamodel_dcasetting', null, true)
&& $objDB->fieldExists('subpalette', 'tl_metamodel_dcasetting', true))
) {
$subpalettes = $objDB->execute('SELECT * FROM tl_metamodel_dcasetting WHERE subpalette!=0');

if ($subpalettes->numRows) {
Expand Down

0 comments on commit d37da60

Please sign in to comment.