Jump to content

HTTP ERROR 500


E-GOR

Recommended Posts

Hello!

Need help.  Site crashed.

Prestashop 1.6 (Theme Leo moonsun) PHP 7.1

leotempcp.php

Error log:

[Fri Dec 20 17:37:47 2019] [error] [pid 26041] sapi_apache2.c(362): [client 141.8.142.126:59136] PHP Fatal error: Uncaught Error: Cannot use string offset as an array in /public_html/modules/leotempcp/leotempcp.php:1263\nStack trace:\n#0 /public_html/modules/leotempcp/leotempcp.php(102): Leotempcp->getInfo()\n#1 [internal function]: Leotempcp->__construct(false)\n#2 /public_html/Core/Foundation/IoC/Core_Foundation_IoC_Container.php(120): ReflectionClass->newInstanceArgs(Array)\n#3 /public_html/Core/Foundation/IoC/Core_Foundation_IoC_Container.php(157): Core_Foundation_IoC_Container->makeInstanceFromClassName('leotempcp', Array)\n#4 /public_html/Core/Foundation/IoC/Core_Foundation_IoC_Container.php(170): Core_Foundation_IoC_Container->doMake('leotempcp', Array)\n#5 /public_html/Adapter/Adapter_ServiceLocator.php(52): Core_Foundation_IoC_Container->make('leotempcp')\n#6 /public_html/modules/leotempcp/leotempcp.php on line 1263

Part leotempcp.php file:

   public function getInfo()
    {
        $theme_dir = $this->themeName;

        $output = array();
        $output = array('skins' => '', 'layouts' => '');

        $directories = glob(_PS_ALL_THEMES_DIR_.$theme_dir.'/css/skins/*', GLOB_ONLYDIR);

        if ($directories) {
            foreach ($directories as $dir) {
                $output['skins'][basename($dir)]['name'] = $this->l(basename($dir));
                if (file_exists($dir.'/icon.png')) {
                    $output['skins'][basename($dir)]['icon'] = _PS_BASE_URL_._THEME_DIR_.'css/skins/'.basename($dir).'/icon.png';
                }
            }
        }

        $xml = LeoFrameworkHelper::getThemeInfo($this->themeName);
        if (isset($xml->theme_key)) {
            # validate module
            $this->themeKey = trim((string)$xml->theme_key);
        }
        return $output;
    }

If disable  #$output = array('skins' => '', 'layouts' => '');

Site working, but admin dash theme panel dont work and slider+megamenu crashed layouts.

leotempcp.php

Link to comment
Share on other sites

Hello, revalidate yourversion of php if compatible with module. See your code in define var:

$output = array('skins' => '', 'layouts' => '');

2 space of memory and later use three:

$output['skins'][basename($dir)]['name']

Text you validate here.

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