JCB not loading... Returns a "Parse Error" #334
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#334
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
Just installed latest version
Expected result
Component to load
Actual result
Parse error: syntax error, unexpected '.', expecting ')' in ...administrator\components\com_componentbuilder\helpers\componentbuilder.php on line 2339
and the same error on line 2408
System information (as much as possible)
Additional comments
The following solved the problem:
Changed line 2339 from this:
Into this:
And on line 2408 from this:
Into this:
Okay, I will update that, but just that you know. We have moved JCB to PHP 7 and are not testing it in version PHP 5 anymore. So thanks for the headsup, and if you run in to any more issues your are welcome to let us know.
Thank you for accommodating me. I see you have been working late and have updated it already, thanks. However, the same errors are being returned (it's complaining about the '.'), $default still has to be changed into an empty string in the function variables itself (see in my updates above - line 2339 & 2408... I changed it to: $default = '').
Woops missed that :)
I also know that this issue is able to be fixed by making some changes to your PHP settings... if I remember correctly. I think we had this issue before... let me look.....
Hmm I see there was two issues surrounding this...
Issue 190
Issue 187
Also seems like @joomlaserbia had a better solution to the issue... I think I will combine the two 👍 not sure how I missed his last reply.
Please next time help me, by searing the closed issues for past posts surrounding the same issue, and just start commenting on it again.. that way others Googleing can find the answers easier.
Sure, thanks.
Can you do me a quick favor... can you test this option:
Since I see the
$default = '{JPATH_SITE}/images/'
is not working.O it should look like this instead...
None of those two work.
($default = JPATH_SITE . "/images/")
Returns: Parse error: syntax error, unexpected '(', expecting '&' or variable (T_VARIABLE) in ...
$default = (JPATH_SITE . "/images/")
Returns: Parse error: syntax error, unexpected '(' in ...
This one (of joomlaserbia) however does work:
$default = '{JPATH_SITE}/images/'
It seems that since it is working for both me and joomlaserbia who at the time was using php 5.6 and I'm using 5.5.15, and it's not working for you being on php 7+, it's best to keep it the way you changed it last night - the way it is now, so it works on all php versions natively (and safely in all future php versions too).
Update:
I get the same error when compiling:
Parse error: syntax error, unexpected '.', expecting ',' or ';' in ... \administrator\components\com_componentbuilder\helpers\compiler\a_Get.php on line 26
...same error on line 33, 40 and 275
Solution:
On lines 26, 33 and 40...
Changed this:
Into this:
On line 275...
Changed this:
Into this:
Then same error in another file:
Parse error: syntax error, unexpected '.', expecting ')' in ... \administrator\components\com_componentbuilder\helpers\compiler\e_Interpretation.php on line 15678
On line 15678...
Changed this:
Into this:
Well there is a separating
'#' . '#' . '#'
string there because we are moving towards the option of parsing the compiler files when compiling JCB itself (we need that for the language strings and other mind bending future plans), and if those strings are like###
JCB will pick them up and convert them, or try to pull data from them, which is what it already does with other files.I would suggest you upgrade your php to the latest, or at least 5.6
We simply can't change those strings, and adding them to a method will slow JCB down as they are used extensively across the compiler.
Ok, no prob. I will do the upgrade and see what happens. Thanks. And thank you for this wonderful component, it's a great project and you have done an excellent job of it!