Event OnContentAfterTitle Only Accepts String Results. - Question | JoomShaper

Event OnContentAfterTitle Only Accepts String Results.

JG

Jamie Gilbert

SP Page Builder 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

0
17 Answers
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #149855

Hello Jamie Gilbert

This issue comes from VirtueMart. Please contact their support.

Best regards

-1
JM
Jeremy Magne
Accepted Answer
9 months ago #182144

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

1
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 9 months ago #182280

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.

0
JG
Jamie Gilbert
Accepted Answer
9 months ago #182436

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

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 9 months ago #182495

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.

0
JG
Jamie Gilbert
Accepted Answer
9 months ago #182665

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.

0
JM
Jeremy Magne
Accepted Answer
9 months ago #182666

@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 '';

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 9 months ago #182678

Jamie Gilbert,

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

0
JM
Jeremy Magne
Accepted Answer
8 months ago #184125

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...

0
JG
Jamie Gilbert
Accepted Answer
8 months ago #184128

Login details work, just tied them myself.. make sure you are using the TEST site - https://hopeful-wing.111-67-29-104.plesk.page/

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 8 months ago #184795

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

0
JM
Jeremy Magne
Accepted Answer
8 months ago #184945

/plugins/content/spapgebuilder/spapgaebuilder.php

Line 256 Replace

return true;

by

return '';

then line 272 replace

return;

by

return '';
0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 8 months ago #184952

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.

0
S
Sandra97
Accepted Answer
1 year ago #165917

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.

0
JG
Jamie Gilbert
Accepted Answer
1 year ago #165925

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.

0
S
Sandra97
Accepted Answer
1 year ago #165944

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.

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 8 months ago #184276

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

0