From fbd495719db4883998745790d892b906d0dc7dcc Mon Sep 17 00:00:00 2001 From: mMarinetti Date: Mon, 13 Feb 2012 14:57:21 +0000 Subject: [PATCH] // fix #PSTEST-490 : imported theme are now correctly added (some themes with variations, like cloth, wasn't --- modules/themeinstallator/themeinstallator.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/themeinstallator/themeinstallator.php b/modules/themeinstallator/themeinstallator.php index b608d486e..bbf897483 100644 --- a/modules/themeinstallator/themeinstallator.php +++ b/modules/themeinstallator/themeinstallator.php @@ -586,18 +586,16 @@ class ThemeInstallator extends Module { if ($variation == 'prestashop') continue; - $target_dir = _PS_ALL_THEMES_DIR_.$theme_directory; if ($variation != $theme_directory) - $target_dir .= $variation; + $theme_directory .= $variation; + + $target_dir = _PS_ALL_THEMES_DIR_.$theme_directory; $res &= self::recurseCopy(_IMPORT_FOLDER_.'themes/'.$variation, $target_dir); $new_theme = new Theme(); $new_theme->name = (string)$this->xml['name']; - if (isset($this->xml['directory'])) - $new_theme->directory = (string)$this->xml['directory']; - else - $new_theme->directory = (string)$this->xml['name']; + $new_theme->directory = $theme_directory; $res &= $new_theme->add(); if ($res)