Event onContentAfterTitle only accepts String results. - Forum | JoomShaper
Staff replied SP Page Builder

Event onContentAfterTitle only accepts String results.

Asked by Jamie Gilbert 2 years ago Last activity 1 year ago

Hi

Testing J5 upgrade and getting an error "Event onContentAfterTitle only accepts String results." on one page, the error is coming from "Content - SP Page Builder" plug, if I disable this, then problem goes away, however then articles that have page builder content don't work as you work expect..

website
https://hopeful-wing.111-67-29-104.plesk.page/

Click on the "SHOP" menu item for error.

thanks in advance

5 replies

Ofi Khan Staff

Hello Jamie Gilbert

This issue comes from VirtueMart. Please contact their support.

Best regards

Jeremy Magne

The issue is not with Virtuemart. It's with content plugin SP Page Builder.
If there is no article id, the plugin return false, it should return an empty string instead.
The fall back return should also return an empty space.

The error is triggered when you use virtuemart because the content plugins are triggered and there is no 'ID' attibute to the $article being passed. Virtuemart uses virtuemart_product_id instead.

Never the less, change your content plugin with this simple fix. You will save headaches to many customers.

Problem is still occuring on SP Page Builder 5.4.6

Ofi Khan Staff

I have not found it on Shop page while Content - SP Page Builder plugin is enabled. Could you please reproduce the issue? Then I will share it with the developer team.

Jamie Gilbert Asked this

Hi Ofi, I have updated our test website to the latest Page Builder, VirtueMart and Joomla (plus some others), enabled the Joomla Plug again on VirtueMart and the error is now present again, when you clikc on the SHOP menu.

Hopefully this can now be resolved given the insights by Jeremy Magne

Thanks

Jamie

Ofi Khan Staff

For further testing, I need to check your site on my localhost. Please take a full site backup with Akeeba Backup in ZIP format and share here. Follow this tutorial. I will investigate the issue further on my localhost.

Jamie Gilbert Asked this

Hi Ofi, I DO NOT authorise taking a copy of the website, there is a lot of personal information, and I don't want this going elsewhere. Please only debug / experiment on this site, it's a TEST Site for us and not productive, so you can play with it.

Jeremy Magne

@jamie, @Ofi
In the code of SP Page Builder content plugin.
The error is clear and simple :
Event onContentAfterTitle only accepts String results.

Your plugin returns a Boolean

Line 248:
replace return false;
by return '';

Line 264:
replace return false;
by return '';

Ofi Khan Staff

Jamie Gilbert,

The access does not work. Please share it in the hidden content again.

Jeremy Magne

Version 5.5.2 was released and your plugin still crashes.
When will you fix the function onContentAfterTitle in YOUR plugin ?
This is not n issue with Virtuemart it's an issuer with SP Pagew Builder content plugin.

the function onContentAfterTitle should retur a string but your plugin returns a boolean.

You have been given the fix many times but your are still not fixing it...

Ofi Khan Staff

Please share me the exact file location and where to edit. Then I will talk to developer team directly.

Jeremy Magne

/plugins/content/spapgebuilder/spapgaebuilder.php

Line 256 Replace

return true;

by

return '';

then line 272 replace

return;

by

return '';
Ofi Khan Staff

Thanks for the clear explanation. I will share it with the developer team. If there are no other issues, then they will fix it on the next release. Once again, thank you for your patience and willingness to help.

Sandra97

Hi Ofi,

I have the same issue on a site I'm developing and I'm not using Virtuemart or any specific extension so I doubt the issue is Virtuemart.
And I confirm the issue is gone if I disable the Content - SP Page Builder plugin, tag links work as expected.

Jamie Gilbert Asked this

Hi Sandra97, in the end I found if I turned off the Virtuemart setting "Enable Joomla Plugin", and this resolved the issue! So guessing there is some other plug within your website that is conflicting in the same way and creating the same problem as I had.

Suggest you disable them one by one and then see what it is.

Sandra97

Hi Jamie,

I disabled each 3rd party plugin I'm using (I use only a few on this site) but it doesn't change anything so it's not coming from another 3rd party extension.

Ofi Khan Staff
1 year ago · edited

I will talk with the developer team about this fix and update you.

Log in to reply.