Jump to content

HTTP 500 error - array key


jrgrafisk

Recommended Posts

This is the message i get after enabling debug. 
I haven't done much work on this shop for some time, so I really can't tell if someone else has been doing something that I do not know about

Any of you have an idea as to what i should try?

Reverted to php 7.4. That sometimes helps. Deleted .htaccess to force a regeneration of it. 

Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, Shop given in /customers/0/8/2/nettotruck.dk/httpd.www/src/Adapter/EntityMapper.php:99 Stack trace: #0 /customers/0/8/2/nettotruck.dk/httpd.www/src/Adapter/EntityMapper.php(99): array_key_exists('id_shop', Object(Shop)) #1 /customers/0/8/2/nettotruck.dk/httpd.www/classes/ObjectModel.php(264): PrestaShop\PrestaShop\Adapter\EntityMapper->load('1', NULL, Object(Shop), Array, NULL, true) #2 /customers/0/8/2/nettotruck.dk/httpd.www/classes/shop/Shop.php(128): ObjectModelCore->__construct('1', NULL, NULL) #3 /customers/0/8/2/nettotruck.dk/httpd.www/classes/shop/Shop.php(411): ShopCore->__construct('1') #4 /customers/0/8/2/nettotruck.dk/httpd.www/config/config.inc.php(118): ShopCore::initialize() #5 /customers/0/8/2/nettotruck.dk/httpd.www/admin848u84cdu/index.php(40): require('/customers/0/8/...') #6 {main} thrown in /customers/0/8/2/nettotruck.dk/httpd.www/src/Adapter/EntityMapper.php on line 99

 

Link to comment
Share on other sites

This just now happened at my webstore:

Error 500:

Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, Shop given in /customers/a/b/0/website/httpd.www/src/Adapter/EntityMapper.php:99 Stack trace: #0 /customers/a/b/0/website/httpd.www/src/Adapter/EntityMapper.php(99): array_key_exists('id_shop', Object(Shop)) #1 /customers/a/b/0/website/httpd.www/classes/ObjectModel.php(264): PrestaShop\PrestaShop\Adapter\EntityMapper->load('1', NULL, Object(Shop), Array, NULL, true) #2 /customers/a/b/0/website/httpd.www/classes/shop/Shop.php(128): ObjectModelCore->__construct('1', NULL, NULL) #3 /customers/a/b/0/website/httpd.www/classes/shop/Shop.php(414): ShopCore->__construct('1') #4 /customers/a/b/0/website/httpd.www/config/config.inc.php(118): ShopCore::initialize() #5 /customers/a/b/0/website/httpd.www/index.php(27): require('/customers/a/b/...') #6 {main} thrown in /customers/a/b/0/website/httpd.www/src/Adapter/EntityMapper.php on line 99

Link to comment
Share on other sites

1 minute ago, pandorrah said:

This just now happened at my webstore:

Error 500:

Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, Shop given in /customers/a/b/0/website/httpd.www/src/Adapter/EntityMapper.php:99 Stack trace: #0 /customers/a/b/0/website/httpd.www/src/Adapter/EntityMapper.php(99): array_key_exists('id_shop', Object(Shop)) #1 /customers/a/b/0/website/httpd.www/classes/ObjectModel.php(264): PrestaShop\PrestaShop\Adapter\EntityMapper->load('1', NULL, Object(Shop), Array, NULL, true) #2 /customers/a/b/0/website/httpd.www/classes/shop/Shop.php(128): ObjectModelCore->__construct('1', NULL, NULL) #3 /customers/a/b/0/website/httpd.www/classes/shop/Shop.php(414): ShopCore->__construct('1') #4 /customers/a/b/0/website/httpd.www/config/config.inc.php(118): ShopCore::initialize() #5 /customers/a/b/0/website/httpd.www/index.php(27): require('/customers/a/b/...') #6 {main} thrown in /customers/a/b/0/website/httpd.www/src/Adapter/EntityMapper.php on line 99

So, this seems to be some kind of update to a module that triggers it?

I will just try to disable all non-core modules

Link to comment
Share on other sites

1 minute ago, pandorrah said:

Then i guess the problem lies with them as i am hosted there aswell. I will contact them and let you know their answer. Site was working perfectly this morning.

I appreciate it. 
This naturally happens on my day off - on top of a cold. Life is great :D

Link to comment
Share on other sites

one.com advises to revert to php 7.4 and wait 30 mins for it to have effect. i have done that, but i think the problem will remain...
analyzing the error we both have, i have downloaded Prestashop 1.7.8.0 and copied the file > Src > Adapter > EntityMapper.php

It seems that the array_key_exists() is deprecated and the new file from 1.7.8.0 has other syntaxis. I will wait and are online with one.com support....

Link to comment
Share on other sites

Reverting back to PHP 7.4 and waiting for at least 30 minutes does the job. Your website whould be working then again. It works for me. I am operational again. 

On a sidenote: i have upgraded last month from Prestashop 1.7.7.8 to 1.7.8.0, but there were some errors that couln'd be fixed then. So i reverted back to 1.7.7.8 and it is working as it should be. 

On the PHP side: a lot of big changes have been made in the new version, since 7.4. There are significant changes. I recommend to copy your site and make an upgrade offline from that copy (e.g. WAMP, XAMPP).

Link to comment
Share on other sites

Prestashop is not compatible with PHP8 yet, stay on 7.4! After any PHP version change delete the cache by renaming /var/cache folder on FTP to /var/cache_old - it will regenerate automatically with next page call

Link to comment
Share on other sites

  • 2 years later...

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