from a constructor is deprecated - Forum | JoomShaper
Staff replied SP Page Builder

from a constructor is deprecated

Asked by John 2 months ago Last activity 2 months ago

Hello Joomshaper,

I just updated the SPPB from 6.6.2 to 6.7.0, and an error message has appeared:

Deprecated: Returning a value from a constructor is deprecated in /home/customer/www/xxx.com/public_html/components/com_sppagebuilder/parser/addons.php on line 51

Then I located the below code:

public function __construct($addon)
{ if (!$addon)
{
return false;
}
$this->addon = $addon;
}

After I deleted this line:
return false;

The error disappears.

Please let me know if the above corrections are feasible, and is there any other places need to be fixed?

Thank you.
John

3 replies

Paul Frankowski Senior Staff
2 months ago · edited

Hi John,

Are you using PHP 8.5 there?

I will ask our developer to check that, big thanks for analize.

John Asked this

Hi Paul,

I am using PHP 8.6.0, thanks.

John

Paul Frankowski Senior Staff

unfortunately, we are not fully ready for PHP 8.6 yet, that's why.

anyway, thanks

Log in to reply.