Parse error in com_componentbuilder/helpers/componentbuilder.php on line 1496 #187

Closed
opened 2017-11-28 01:10:38 +00:00 by wp-serbia · 2 comments
wp-serbia commented 2017-11-28 01:10:38 +00:00 (Migrated from github.com)

Steps to reproduce the issue

Fresh install

Expected result

Actual result

Parse error: syntax error, unexpected '.', expecting ')' in ... administrator/components/com_componentbuilder/helpers/componentbuilder.php on line 1496

System information (as much as possible)

Ubuntu Server 14.10 Apache 2.2 PHP 5.6

Additional comments

### Steps to reproduce the issue Fresh install ### Expected result ### Actual result Parse error: syntax error, unexpected '.', expecting ')' in ... administrator/components/com_componentbuilder/helpers/componentbuilder.php on line 1496 ### System information (as much as possible) Ubuntu Server 14.10 Apache 2.2 PHP 5.6 ### Additional comments

Please check you php.

If you look at the line 1496 you will see it is concatenating strings in arguments values. I have seen this before, but it usually is due to low php version that you will get an error.

But okay it seems there is a fix. Can you try some of these and let me know what worked. The I will patch this.

Please check you php. If you look at the [line 1496](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/helpers/componentbuilder.php#L1496) you will see it is concatenating strings in arguments values. I have seen this before, but it usually is due to low php version that you will get an error. But okay it seems there is a fix. Can you try [some of these ](https://stackoverflow.com/questions/13833352/concatenating-strings-in-arguments-php)and let me know what worked. The I will patch this.
wp-serbia commented 2017-11-28 20:57:08 +00:00 (Migrated from github.com)

Hello,

I solved my problem - this was caused with PHP version;

Site info:
Database Version | 5.5.57-0ubuntu0.14.04.1
Database Collation | utf8mb4_general_ci
Database Connection Collation | utf8mb4_general_ci
PHP Version | 5.5.9-1ubuntu4.22
Web Server | Apache
WebServer to PHP Interface | apache2handler
Joomla! Version | Joomla! 3.8.2 Stable [ Amani ] 7-November-2017 15:00 GMT
Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

I changed line 1496
from:

public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = JPATH_SITE . '/images/', $createIfNotSet = true)

to this:

public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key ='', $default = '{JPATH_SITE}/images/', $createIfNotSet = true)

I changed line 1565
From:

public static function getFolderPath($type = 'path', $target = 'folderpath', $default =  JPATH_SITE. '/images/', $createIfNotSet = true)

to:

public static function getFolderPath($type = 'path', $target = 'folderpath', $default =  '{JPATH_SITE}/images/', $createIfNotSet = true)

Regards and happy coding 💯

Hello, I solved my problem - this was caused with PHP version; Site info: Database Version | 5.5.57-0ubuntu0.14.04.1 Database Collation | utf8mb4_general_ci Database Connection Collation | utf8mb4_general_ci PHP Version | 5.5.9-1ubuntu4.22 Web Server | Apache WebServer to PHP Interface | apache2handler Joomla! Version | Joomla! 3.8.2 Stable [ Amani ] 7-November-2017 15:00 GMT Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT User Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 I changed line 1496 from: ``` public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = JPATH_SITE . '/images/', $createIfNotSet = true) ``` to this: ``` public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key ='', $default = '{JPATH_SITE}/images/', $createIfNotSet = true) ``` I changed line 1565 From: ``` public static function getFolderPath($type = 'path', $target = 'folderpath', $default = JPATH_SITE. '/images/', $createIfNotSet = true) ``` to: ``` public static function getFolderPath($type = 'path', $target = 'folderpath', $default = '{JPATH_SITE}/images/', $createIfNotSet = true) ``` Regards and happy coding 💯
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#187
No description provided.