Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Solved] Trying to install PS 1.6 theme - PHP error

Featured Replies

Hi there

I know this is a PHP error, but hopefully you guys can provide a fix...
I'm trying to install one of Leo Theme's templates: Game Gear
https://www.leotheme.com/prestashop/themes/313-leo-gamegear.html

But I'm getting the following 500 error:

in file modules/leotempcp/leotempcp.php at line 1263

Cannot use string offset as an array
in file modules/leotempcp/leotempcp.php at line 1263


1261:        if ($directories) {
1262:            foreach ($directories as $dir) {
1263:                $output['skins'][basename($dir)]['name'] = $this->l(basename($dir));
1264:                if (file_exists($dir.'/icon.png')) {
1265:                    $output['skins'][basename($dir)]['icon'] = _PS_BASE_URL_._THEME_DIR_.'css/skins/'.basename($dir).'/icon.png';
1266:                }
1267:            }
1268:        }

 

Can you please help? Got a feeling that line 1263 needs to be rewritten for latest PHP (I'm running 7.2+)

Your help is appreciated in advance!

Edited by Theo

  • Author
17 minutes ago, Occam said:

Did you recompile the theme afterwards?

Theme bombs out on accessing admin with Error 500, so I can't get to Performance screen.
The only way I got to see what was going on was by activating Debug in defines.inc.php.
Now after file update and page refresh, the error page reflects the update in the code that it displays and highlights (so not a caching thing where it still uses previous version).

Edited by Theo

  • Author

Ah spoke to soon... Sorry @datakick, need your help again please.


New error:

Call to a member function attributes() on boolean line 1480

Highlighted: $xmlAttributes = $xml->attributes();

 

Call to a member function attributes() on boolean in file controllers/admin/AdminThemesController.php at line 1480

 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'];

 

 

Edited by Theo

Glad someone else is having issues .. I thought it was just me.. I, too, had the 500 page and gave up ..Although now have bits left over from removing 😞

  • Author
9 minutes ago, AndyC said:

Glad someone else is having issues .. I thought it was just me.. I, too, had the 500 page and gave up ..Although now have bits left over from removing 😞

Do you know that you can show the error detail on the 500 page? Because normally it's just blank with 500 error. And it doesn't give any detail.

If you don't know: go to your sites folder/config and edit defines.inc.php.
Change:
define('_PS_MODE_DEV_', false); to 
define('_PS_MODE_DEV_', true);

This will then show you the error detail, which you can post here

Edited by Theo

34 minutes ago, Theo said:

Ah spoke to soon...
New error:

Call to a member function attributes() on boolean line 1480

Highlighted: $xmlAttributes = $xml->attributes();

 


Call to a member function attributes() on boolean in file controllers/admin/AdminThemesController.php at line 1480

 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'];

 

 

What you can do is to test before and you won't get the error, like this on line 1480 :
 

1476:            if ($sandbox) {
1477:                // Load configuration of the theme package.
1478:                $sandboxDir = $sandbox.'/'.$themeDir;
1479:                $xml = Theme::loadDefaultConfig($sandboxDir);
1480:                if (isset($xml->attributes())) $xmlAttributes = $xml->attributes();
1481:                $targetDir = _PS_ALL_THEMES_DIR_.$xmlAttributes['directory'];

 

 

 

 

Edited by zen

  • 3 weeks later...

Hi

I am attempting to change to this theme again now too

I've done the datakick suggestion on line 1256-1257  and am attempting to upgrade to bleeding edge .. I have never dome this before so is the latest 1.1 or the issue -905

thanks

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.