Solved Templates

Deprecated Warning after php and components update

Asked by gemmajoom 3 years ago Last activity 2 years ago

Error after php (8.1) and components update

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/customer/www/sitename.it/public_html/templates/shaper_hope/html/layouts/chromes/sp_xhtml.php on line 28

Warning appears only on some pages and remains visible even if I deactivate the error report.

The error remains even if I try to go back to the previous version of the php (8.0).

Accepted answer

Marked as the solution
Paul Frankowski Senior Staff

I have idea that may work:

  1. Download Helix3 template/quickstart
  2. Take from it that file: templates/shaper_helix3/html/layouts/chromes/sp_xhtml.php
  3. Using FTP override file here: templates/shaper_hope/html/layouts/chromes/sp_xhtml.php
gemmajoom Asked this

ThankYou Paul, it works now!

3 more replies

Ofi Khan Staff

Hello gemmajoom

Apology for the inconvenience. I cannot see any warning or error on the page now. Please share your administrator access here to check the issue. Use the Hidden Content box to share the credentials. Make sure that you have a full site backup with you before sharing.

Best regards

gemmajoom Asked this
3 years ago · edited

Not being able to leave the site in production with this error, a restore to the previous version was made.
I confirm that the error occurs by updating the php to version 8.1, while with 8.0 everything seems ok.

We have it locally and I can report the full error statement below:

Ofi Khan Staff

Hope template is not compatible with PHP 8.1. Please use PHP 8.0 on the template. We will update it soon.

Please accept the answer that helped you. It will be then easier to find the solution for the other users with the same issue. There is a button to accept answer after each comment.

Alessandro Coraglia

hi, do you have any updates on Newsberg?
I have a massive list of deprecated content, and I am using Joomla 4, which now requires PHP 8+.

I can hide the report errors, but still, the code is unsafe (as it's deprecated)

Log in to reply.