PHP Error On Buttons - Question | JoomShaper

PHP Error On Buttons

Simon Logan

Simon Logan

SP Page Builder 3 years ago

Started getting this error on multiple sites now when there is a button present but only if the button is edited (ie existing ones untouched don't seem to trigger the error):

Recoverable fatal error: Object of class stdClass could not be converted to string in /path-to-site-on-server/www/mywebsite.com/public_html/components/com_sppagebuilder/addons/button/site.php on line 25

0
14 Answers
Simon Logan
Simon Logan
Accepted Answer
3 years ago #9237

Sorry I selected the wrong site there and can't edit it after posting, should be https://www.exterity.com

Also the site was running on PHP 7.3 so I tried switching to 7.4 but error was the same.

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #9246

Hello Simon Logan

Please share the site.php file here. I will fix it and send it back.

Best regards

0
Simon Logan
Simon Logan
Accepted Answer
3 years ago #9255

I don't seem to be able to attach anything - it's just the core file from the latest release, however. The line in question is this one:

$attribs .= (isset($settings->url) && $settings->url) ? ' href="' . $settings->url . '"' : '';
0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #9257

Please share your administrator access here to check. Use the Hidden Content box to share the credentials.

0
Simon Logan
Simon Logan
Accepted Answer
3 years ago #9261

Here you go

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #9263

Please share the exact page link of where the issue occurs so that I can see it.

0
Simon Logan
Simon Logan
Accepted Answer
3 years ago #9264

I'm comfortable editing the source file if you let me know what adjustment needs made by the way.

0
Simon Logan
Simon Logan
Accepted Answer
3 years ago #9270

It was occurring on the homepage so i had to disable all the buttons there otherwise it would look like the entire site was down, let me try and find another page as an example.

0
Simon Logan
Simon Logan
Accepted Answer
3 years ago #9272

It's on the homepage now if you look quickly

0
Simon Logan
Simon Logan
Accepted Answer
3 years ago #9273

Although I can only leave it like that for a few seconds for obvious reasons, it's a high-traffic site.

To view it yourself if you edit the homepage and re-enable some of the buttons, then save and refresh the page - as long as you can immediately revert the buttons to unpublished if the page goes down.

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #9383

I have duplicated Homepage (En) page and enabled the buttons. It seems that one button has issues. I hope it is fixed now.

0
Simon Logan
Simon Logan
Accepted Answer
3 years ago #9410

Thanks Ofi. Can you clarify what the fix was as we've experienced this on other sites so it would be good to be able to fix it myself.

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #9499

I could not figure out the issue. I deleted that button and created a new one. Only one button had the issue.

0
Simon Logan
Simon Logan
Accepted Answer
3 years ago #9601

Can you clarify which button it was that was causing the issue? Since I've seen this issue on other sites I need to at least have an idea as to what is causing it, ie whether it's the JSON data being old or corrupted, and if the fix is simple to replace all the buttons or create new versions of them if the errors appears.

0