Jump to content
thirty bees forum
  • 0

Question

Posted (edited)

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

13 answers to this question

Recommended Posts

  • 0
Posted

Looks like config.xml file is not present in the theme installation pack. Please check.

Anyway, thirtybees should display proper error message when you try to upload invalid theme package. This will be fixed 

  • 0
Posted (edited)
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
  • 0
Posted
4 hours ago, bhtoys said:

and now I have this problem. Tried uploading - nope. 
Tried doing the ftp - nope. 

Keep getting a 500 error. 

And what does the error message says? 

  • 0
Posted

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.

  • 0
Posted
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(



 

  • 0
Posted

your theme either does not contain config.xml file, or this file is invalid. Please look into zip file to see if this config.xml is there. If so, please attach. 

 

  • 0
Posted

Than it's not a valid ps16 theme. Maybe it's ps17? Or maybe it's a zip file that contains another zip file (the actual theme) -- developers sometimes distribute themes this way

  • 0
Posted

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.

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...