Jump to content
thirty bees forum
  • 0

After updating to 1.5 I get "500 Server Error" Startseiten-Texteditor v2.6.0 - von PrestaShop Ein Texteditor-Modul für Ihre Startseite"


Question

Posted (edited)

Hello,

 

After updating to 1.5 I get "500 Server Error" when I try to save.

"Front-Office Funktionen
Startseiten-Texteditor v2.6.0 - von PrestaShop
Ein Texteditor-Modul für Ihre Startseite"

I am using PHP 8.0.

The problem did not disappear when I get the latest bleeding edge.

Debugger says:

TypeError

key_exists(): Argument #2 ($array) must be of type array, EditorialClass given

in file modules/editorial/EditorialClass.php at line 80
public function copyFromPost()
76:	{
77:		/* Classical fields */
78:		foreach ($_POST as $key => $value)
79:		{
80:			if (key_exists($key, $this) && $key != 'id_'.$this->table)
81:				$this->{$key} = $value;
82:		}

Thanks a lot

Josef

 

ps

I am using now and it works. But if you see a problem let me know. Thanks. Josef

Front-Office Funktionen
HTML-Block v1.2.1 - von thirty bees
 
 

 

Edited by jn1

3 answers to this question

Recommended Posts

  • 0
Posted
6 hours ago, jn1 said:

Hello,

 

After updating to 1.5 I get "500 Server Error" when I try to save.

"Front-Office Funktionen
Startseiten-Texteditor v2.6.0 - von PrestaShop
Ein Texteditor-Modul für Ihre Startseite"

I am using PHP 8.0.

The problem did not disappear when I get the latest bleeding edge.

Debugger says:

TypeError

key_exists(): Argument #2 ($array) must be of type array, EditorialClass given

in file modules/editorial/EditorialClass.php at line 80
public function copyFromPost()
76:	{
77:		/* Classical fields */
78:		foreach ($_POST as $key => $value)
79:		{
80:			if (key_exists($key, $this) && $key != 'id_'.$this->table)
81:				$this->{$key} = $value;
82:		}

Thanks a lot

Josef

 

This module does not support php8.

If you already rolled back to your backup set your php version to 7.4, update TB core to 7.4, install Collectlogs module and observe the warnings that this module will rise. Fix the all the issues that are generating during 7.4 and then BACKUP again and try an update to php8.
 

  • Like 1
  • 0
Posted

This is very common problem with a lot of older modules. 

When you see this error (on PHP8) or warning (on PHP7), then replace

key_exists($key, $this)
array_key_exists($key, $this)

with

property_exists($this, $key)

The first two functions can be used with array only. If object is passed instead, older versions of PHP converted this object to array automatically (silently, or with warning). PHP8 do not do this automatic conversion, and fails instead.

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