Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Error in helper file. 08 Jul 2016 23:26 #14194

Hi, I have just reloaded a component for testing in my test environment and the following error is now occurring..
Parse error: syntax error, unexpected '[', expecting ']' in /home/safereco/public_html/test/administrator/components/com_srrisk/helpers/file.php on line 2115

Please Log in or Create an account to join the conversation.

Error in helper file. 09 Jul 2016 09:18 #14195

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Syntax look good for me.

can you make a dump of $attribs at line 2096 after the var check
if (!$attribs)
	return;
echo("<pre>"); print_r($attribs); echo("</pre>");

Ouch, many errors with this 2.9.
Remember, in the meanwhile, you still can generate in Legacy 2.8.x

I'll check that, but I can't see on my side, so if you can make a dump.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Error in helper file. 09 Jul 2016 20:47 #14200

Hi, it works from the base component downloaded from JCook.. I had done a little hack to get this component to talk to another one with shared data on it. The error appears after I had changed the sql calls.

Couldn't get the dump to work. "myfault due to lack of knowlege" but noticed if I took out the [0] from the line , I did not get the error.

Please Log in or Create an account to join the conversation.

Error in helper file. 10 Jul 2016 18:16 #14201

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
At line 2115, $att is an array.
so
$att[] = "...";
is correct

But it is true, that the whole $attribs structure has changed. It is now an object and this is source of numerous issues in the code. But in your case this shouldn't happen because any shape it would have, you would not be able to raise that error.

In case you mix two components, then JDom can eventually be lost in the different calls of the helper.
I am very interrested to check this closer because I am working on compatibility layer.

In case, you can force JDom to work with your desired component (component Helper required for files).
In your concerned JDom call :
...
'extension' => 'com_xxxx'

It should work.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Last edit: by admin.

Error in helper file. 08 Aug 2016 04:01 #14379

Hi Chef, just tested a component in sandbox - works fine .. upoaded an image and saved correctly. On my testing site I am still getting.

Parse error: syntax error, unexpected '' in /home/safereco/public_html/test/administrator/components/com_simplysafe/helpers/file.php on line 2114

This comes up on save or save and close. Strange that it works on sandbox.

This is on the latest stable j-cook.. Running on Joomla 3.6.2

Please Log in or Create an account to join the conversation.

Last edit: by jonathanbell. Reason: Just added the joomla a jcook version

Error in helper file. 08 Aug 2016 09:23 #14380

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Strange.

I downloaded and tested your component in local Joomla 3.6, it works like a charm.
Did you tried on a fresh Joomla install ?
Which PHP version ? Maybe you have a more recent version than me.

The following code (causing the error), is not used for you at the moment, because the images filters are not used yet. It is gonna come in future, but at the moment, you might not use them. Filters are complex because they are flexible structures. This is Joomla coding problem wich forces me to do this weird code.
It will evolve for sure. But at the moment it should work.

Solution : comment/remove all this part :
foreach(get_object_vars($attribs->filters) as $filter => $value)
{
	if (is_object($value))
		$value = JArrayHelper::fromObject($value);

	if (is_array($value))
		$value = $value[array_keys($value)[0]];

	$filters[] = $filter . ($value?':'.$value:'');
}

But I am very curious about it because the code is ok. Maybe a recent version of PHP do not allow that way of coding.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Error in helper file. 08 Aug 2016 20:40 #14392

Hi chef. Thanks I will check php versipn tonite and let you know.

PHP 5.3.29 was what the test site was on, so not the latest version. I will change the version of PHP to see if that makes any difference.

Please Log in or Create an account to join the conversation.

Last edit: by jonathanbell. Reason: Add PHP version
  • Page:
  • 1
Time to create page: 0.063 seconds

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started