HP Warnings In Plugins/system/sppagebuilder/sppagebuilder.php (lines 83/86) After Latest Update, GetPageContentById() Breaks Popup Lookup - Question | JoomShaper

is live, now with multi-currency selling.

HP Warnings In Plugins/system/sppagebuilder/sppagebuilder.php (lines 83/86) After Latest Update, GetPageContentById() Breaks Popup Lookup

jean luc trevilly

jean luc trevilly

SP Page Builder 3 days ago

Hello,

After updating SP Page Builder to version [x.x.x] (Joomla 6.1.3, PHP 8.3, Helix Ultimate), the following warnings appear on our home page, which is an SP Page Builder page (com_sppagebuilder, view=page). They do not appear on standard Joomla article pages:

Warning: Object of class stdClass could not be converted to int in /plugins/system/sppagebuilder/sppagebuilder.php on line 83 Warning: Attempt to read property "id" on int in /plugins/system/sppagebuilder/sppagebuilder.php on line 86

The cause is in getPageContentById():

protected function getPageContentById($ids)
{
    $ids = array_map('intval', $ids ?? []);   // line 83
    $idArray = array_map(
        function ($item) {
            return $item->id;                  // line 86
        },
        $ids ?? []
    );

$ids contains objects, since the next closure reads $item->id. The new intval line converts each object to an integer first, so the closure then tries to read ->id on an int. As a result, $idArray ends up with null values, getPopupsByIds() queries for id 0, and no popup can ever be loaded through this method. We do not use popups ourselves, so the only visible effect for us is the warnings, but popups are presumably broken for anyone who does use them.

Suggested fix, which works whether $ids contains objects or plain ids:

$idArray = array_map(
    function ($item) {
        return (int) (is_object($item) ? $item->id : $item);
    },
    $ids ?? []
);

(removing the $ids = array_map('intval', ...) line)

Could you confirm and include a fix in the next release?

Thank you.

0
1 Answers
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 3 days ago #234259

Hello,

Thank you for bringing this to our attention, and we apologize for any inconvenience caused. I have forwarded the details to our development team for review, and they will look into resolving this issue.

Best regards,

0