Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
Kenneth M. Nielsen

import theme results in server 500 error

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

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0

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 

Share this post


Link to post
Share on other sites
  • 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

Share this post


Link to post
Share on other sites
  • 0

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

Keep getting a 500 error. 

 

Share this post


Link to post
Share on other sites
  • 0
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? 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
  • 0

turn on debug mode first in Advanced Parameters > Performance

Share this post


Link to post
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(



 

Share this post


Link to post
Share on other sites
  • 0

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. 

 

Share this post


Link to post
Share on other sites
  • 0

Yeah... There doesn't seem to be a config file in the zip.

So i guess I'm out of luck.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
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.

Share this post


Link to post
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...