Jump to content
thirty bees forum
  • 0

import theme results in server 500 error


Kenneth M. Nielsen

Question

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(

Edited by Kenneth M. Nielsen
Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0
59 minutes ago, Kenneth M. Nielsen said:

Hi Traumflug, How do I get the fix to my installation?

make sure there is a config.xml file in the themes root folder.  also, if you are installing via a pack, there need to be a config.xml file out in the zips root.

or, if memory serves me, you should just be able to ftp the theme to your site, and assuming there is a config.xml file in the root, tb's will pick it up, and let you install it from there.

Edited by SLiCK_303
  • Like 1
Link to comment
Share on other sites

  • 0

When i import from FTP. Also, when I've tried to upload it instead of using the FTP, I get the full error screen with 

500 Server Error

Oops, something went wrong. You can try to refresh this page

If the problem persists please feel free to contact us. Make sure to download encrypted error message and attach it to your email. That will help our engineers to solve this problem quickly.

Link to comment
Share on other sites

  • 0
4 minutes ago, datakick said:

turn on debug mode first in Advanced Parameters > Performance

Source file: controllers/admin/AdminThemesController.php

1461:     * @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(



 

Link to comment
Share on other sites

  • 0

In case it's the awesome top notch theme you always dreamt of: recreating config.xml isn't impossible. Pick one from another theme, change name and directory inside and give it a try. These long lists just tell which modules should be installed along with the theme and where to place their hooks. One can adjust all of this after theme installation by the usual means.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...