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.