Support Forums

Support Offline : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Frontpage Error after updating sp page builder 2.5.4 to 3

Featured Lock Resolved Bug
I have this error on frontpage after updating to 3

Fatal error: Can't use function return value in write context in /components/com_sppagebuilder/helpers/helper.php on line 34

9 Answers

Paul Frankowski - Staff

More than a month ago #Permalink
Hi,
1) I hope that you have backup
2) What template name / developer you have there ?

bfg-mediagroup

More than a month ago #Permalink
Hi
its not a problem of the Template. You can replace this line


if(!empty(trim($value))){


with the following lines.

$trim = trim($value);
if(!empty($trim)){


On many Addons in this Component have the same Problem. Use the same code and replace the Variable in "trim()".

Paul Frankowski - Staff

More than a month ago #Permalink
thanks, but where exactly in component package, here: site\helpers\helper.php - right.
---
Great! Thanks.

bfg-mediagroup

More than a month ago #Permalink
I worte about the Line 34 in the File "./site/helpers/helper.php".
./site/helpers/helper.php:34:
    
if(!empty(trim($value))){

    
$trim = trim($value);
if(!empty($trim)){


But i have also changed following lines:
./site/addons/icon/site.php:54:
                  
if(empty(trim($margin))){


$trim = trim($margin);
if(empty($trim)){



./site/addons/icon/site.php:68:
                        
if(empty(trim($margin_sm))){


$trim = trim($margin_sm);
if(empty($trim)){


./site/addons/icon/site.php:82:

if(empty(trim($margin_xs))){


$trim = trim($margin_xs);
if(empty($trim)){


./site/addons/carousel/site.php:118:

if(empty(trim($padding_md))) {


$trim = trim($padding_md);
if(empty($trim)){


./site/addons/carousel/site.php:133:

if(empty(trim($margin_md))) {


$trim = trim($margin_md);
if(empty($trim)){


./site/addons/carousel/site.php:165:

if(empty(trim($padding_md))){


$trim = trim($padding_md);
if(empty($trim)){


./site/addons/carousel/site.php:181:

if(empty(trim($margin_md))){


$trim = trim($margin_md);
if(empty($trim)){


./site/addons/carousel/site.php:221:

if(empty(trim($padding_sm))){


$trim = trim($padding_sm);
if(empty($trim)){



./site/addons/carousel/site.php:236:

if(empty(trim($margin_sm))){


$trim = trim($margin_sm);
if(empty($trim)){


./site/addons/carousel/site.php:261:

if(empty(trim($padding_sm))){


$trim = trim($padding_sm);
if(empty($trim)){


./site/addons/carousel/site.php:276:

if(empty(trim($margin_sm))){


$trim = trim($margin_sm);
if(empty($trim)){


./site/addons/carousel/site.php:309:

if(empty(trim($padding_xs))) {


$trim = trim($padding_xs);
if(empty($trim)){


./site/addons/carousel/site.php:324:

if(empty(trim($margin_xs))){


$trim = trim($margin_xs);
if(empty($trim)){


./site/addons/carousel/site.php:349:

if(empty(trim($padding_xs))){


$trim = trim($padding_xs);
if(empty($trim)){


./site/addons/carousel/site.php:364:

if(empty(trim($margin_xs))){


$trim = trim($margin_xs);
if(empty($trim)){


./site/addons/feature/site.php:192:

if(empty(trim($icon_padding_md_item))){


$trim = trim($icon_padding_md_item);
if(empty($trim)){


./site/addons/feature/site.php:206:

if(empty(trim($icon_padding_sm_item))){


$trim = trim($icon_padding_sm_item);
if(empty($trim)){


./site/addons/feature/site.php:222:

if(empty(trim($icon_padding_xs_item))){


$trim = trim($icon_padding_xs_item);
if(empty($trim)){

Paul Frankowski - Staff

More than a month ago #Permalink
May I ask you about PHP version used by you.

???? PHP 5.5, PHP 5.6, 7.0.24, 7.1.x ?? ??

Scoupz Support

More than a month ago #Permalink
May I ask you about PHP version used by you.

???? PHP 5.5, PHP 5.6, 7.0.24, 7.1.x ?? ??


This occurs in any php version below 5.5, the function empty() will not accept any arbitrary expressions.
So function calls like trim() inside empty() won't work, as well as variable assignment. It only accepts variables.

See php.net:
http://php.net/manual/en/function.empty.php

"Note:
Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false."

Paul Frankowski - Staff

More than a month ago #Permalink
PHP 5.4 is not supported, so it's waste of time. But thanks for information.
Please support: /components/com_sppagebuilder/layouts/addon/css.php on line 88

Attachments (1)

  • Capture.JPG
    Capture.JPG 13.2 KB

Paul Frankowski - Staff

3 weeks ago #Permalink
@tuannguyen

1) Open new forum topic
2) Deliver more info
a) Template name / developer
b) SPPB which version

be serious, more helpful if you need support.


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Leaderboard (30 days)

Paul Frankowski

Paul Frankowski

Total Accepted Answers: 138
Toufiq

Toufiq

Total Accepted Answers: 39
Sifat

Sifat

Total Accepted Answers: 16
Rifat Wahid Alif

Rifat Wahid Alif

Total Accepted Answers: 11
Shibbir

Shibbir

Total Accepted Answers: 6

100+

Templates

200,000+

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam