Error: Object Of Class StdClass Could Not Be Converted To String - Question | JoomShaper

Error: Object Of Class StdClass Could Not Be Converted To String

KS

Karen Sticher

SP Page Builder 2 years ago

On our dev server our home page suddenly started loading a white screen. I turned on error reporting in Joomla and it says “Recoverable fatal error: Object of class stdClass could not be converted to string in /var/www/vhosts/[domain]/components/com_sppagebuilder/addons/image_layouts/site.php on line 130”. We've compared this site.php file to what's on the live server which is still working as expect and there's no difference. From Google Searches (e.g. https://www.joomshaper.com/forum/question/1741), it appears that the error is within SP Page Builder and we were editing webpages built in SP Page Builder and editing menus which linked to SP Page Builder, when this error occurred.

We're running version 3.7.1. We're about to upgrade to 3.7.12, what else do we need to do to fix this issue? Thanks.

0
17 Answers
Muntasir Sakib
Muntasir Sakib
Accepted Answer
Support Agent 2 years ago #25692

Hello there,

Please share your administrator access with us in the Hidden Content area so that we can have a look at get back to you soon.

Thanks!

0
KS
Karen Sticher
Accepted Answer
2 years ago #25704

Thanks Muntasir, see hidden content

0
KS
Karen Sticher
Accepted Answer
2 years ago #25825

Hi Muntasir, Any progress on this?

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 2 years ago #25862

Hello Karen Sticher

We need to check your template files for this issue. Please share your super user access with us in the Hidden Content.

Best regards

0
KS
Karen Sticher
Accepted Answer
2 years ago #25865

I've amended the access levels. Please use the existing account I set-up & provided details with in the hidden area above.

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 2 years ago #25874

okay, thanks. Please also share your FTP details or share this file. I need to customize this file /components/com_sppagebuilder/addons/image_layouts/site.php

0
KS
Karen Sticher
Accepted Answer
2 years ago #25916

I don't have access to provide FTP details, I can't see how to attach a file here and it's not letting me submit the code pasted in hidden content, so see hidden content for link to view code within source code

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 2 years ago #25923

Sorry for the trouble again. Please go to this location: /components/com_sppagebuilder/addons/image_layouts/site.php and zip site.php file. Then upload it on any drive (Google Drive, One Drive, Box etc.) and share the public link here. Then I will fix the file and share it back. You will replace the file on your site.

0
KS
Karen Sticher
Accepted Answer
2 years ago #25931

See link below - sorry it's not zipped

0
KS
Karen Sticher
Accepted Answer
2 years ago #25936

See note below

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 2 years ago #25987

Please go to this location: components/com_sppagebuilder/addons/image_layouts and replace site.php file with the attached file. You need to unzip the file and then replace.

site.php.zip

0
KS
Karen Sticher
Accepted Answer
2 years ago #26566

We've replaced the site.php file. This made no difference. We then upgraded to version 3.7.12 (from 3.7.1) and this removed the error message, but we still have a blank/white home page - similarly for some other webpages developed in SP Page Builder that were effected when this issue first arose. I'd be grateful if you could urgently advise next steps.

To confirm, I compared the two files and the difference were:

Was: $output .= '<img class="sppb-img-responsive'.$image_strech.''.($placeholder ? ' sppb-element-lazy' : '').'" src="' . ($placeholder ? $placeholder : $image_link) . '" alt="'. $alt_text .'" '.($placeholder ? 'data-large="'.$image_link.'"' : '').' '.($image_width ? 'width="'.$image_width.'"' : '').' '.($image_height ? 'height="'.$image_height.'"' : '').' loading="lazy">';

Now: $output .= '<img class="sppb-img-responsive'.$image_strech.''.($placeholder ? ' sppb-element-lazy' : '').'" src="' . ($placeholder ? $placeholder : is_string($image_link) ? $image_link : $image_link->src) . '" alt="'. $alt_text .'" '.($placeholder ? 'data-large="'.$image_link.'"' : '').' '.($image_width ? 'width="'.$image_width.'"' : '').' '.($image_height ? 'height="'.$image_height.'"' : '').' loading="lazy">';

0
KS
Karen Sticher
Accepted Answer
2 years ago #26589

Note that via my mobile (Safari) I get the error "cannot decode raw data"

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 2 years ago #26604

Please try this code in that place.

$output .= '<img class="sppb-img-responsive'.$image_strech.''.($placeholder ? ' sppb-element-lazy' : '').'" src="' . is_string($image_link) ? $image_link : $image_link->src . '" alt="'. $alt_text .'" '.($placeholder ? 'data-large="'.$image_link.'"' : '').' '.($image_width ? 'width="'.$image_width.'"' : '').' '.($image_height ? 'height="'.$image_height.'"' : '').' loading="lazy">';
0
KS
Karen Sticher
Accepted Answer
2 years ago #26642

Unfortunately that's made no difference (to double check, in Joomla I Cleaned Cache and in Google Chrome I deleted cookies), what else can we try?

0
KS
Karen Sticher
Accepted Answer
2 years ago #26752

We've turned on the debug mode and now get the Notice: Undefined property: stdClass::$id in /plugins/system/gantry/gantry.php on line 234. Please urgently advise.

Line 234 says:

if ($this->isGantryTemplate($template_info->id) && isset($doc->_styleSheets[JURI::root(true) . '/templates/' . $app->getTemplate() . '/css-compiled/bootstrap.css'])) {

Which is in the wider code:

public function onBeforeCompileHead()
{
    $doc = JFactory::getDocument();
    $app = JFactory::getApplication();
    if (!$app->isAdmin()) {
        $template_info = $app->getTemplate(true);
        // If its a gantry template dont load up
        if ($this->isGantryTemplate($template_info->id) && isset($doc->_styleSheets[JURI::root(true) . '/templates/' . $app->getTemplate() . '/css-compiled/bootstrap.css'])) {
            unset($doc->_styleSheets[JUri::base(true) . '/media/jui/css/bootstrap.css']);
            unset($doc->_styleSheets[JUri::base(true) . '/media/jui/css/bootstrap.min.css']);
            unset($doc->_styleSheets[JUri::base(true) . '/media/jui/css/bootstrap-responsive.css']);
            unset($doc->_styleSheets[JUri::base(true) . '/media/jui/css/bootstrap-responsive.min.css']);
            unset($doc->_styleSheets[JUri::base(true) . '/media/jui/css/bootstrap-extended.css']);
            unset($doc->_styleSheets[JUri::base(true) . '/media/jui/css/bootstrap-rtl.css']);
        }
    }
0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 2 years ago #26844

Your recent error is caused in your template file. Please check with your template provider for support.

For the image layout addon issue, please remove all the changes and use your shared file. I have checked this file with our SP Page Builder extension and it is the same file. Make protostar your default template and check the issue.

0