Trying to import theme results in server 500 error, what to do?
* @param string $themeDir
1462: * @param bool $sandbox
1463: * @param bool $redirect
1464: *
1465: * @return bool
1466: *
1467: * @throws PrestaShopDatabaseException
1468: * @throws PrestaShopException
1469: * @since 1.0.0
1470: */
1471: protected function installTheme($themeDir, $sandbox = false, $redirect = true)
1472: {
1473: if ($this->tabAccess['add'] && $this->tabAccess['delete'] && !_PS_MODE_DEMO_) {
1474: $targetDir = _PS_ALL_THEMES_DIR_.$themeDir;
1475:
1476: if ($sandbox) {
1477: // Load configuration of the theme package.
1478: $sandboxDir = $sandbox.'/'.$themeDir;
1479: $xml = Theme::loadDefaultConfig($sandboxDir); 1480: $xmlAttributes = $xml->attributes();
1481: $targetDir = _PS_ALL_THEMES_DIR_.$xmlAttributes['directory'];
1482:
1483: // Copy files of the theme its self.
1484: if (file_exists($targetDir)) {
1485: $this->errors[] = sprintf(
1486: $this->l('Theme wants to install into %s, but this directory exists already.'),
1487: $targetDir
1488: );
1489: } else {
1490: rename(