Fabrik Form Error

mabdelhady

New Member
Hello,

I'm using a fabrik form to search a database table. I have setup my form to redirect to the database table list after submission and set it to be used to search data. The redirect link is:

/index.php?option=com_fabrik&view=list&listid=19&resetfilters=1

Every time a user submits a search query they get the following error:

SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data

Any idea why this is happening?!

Regards,

Mona
 
Usually this is an error message or warning returned in the network response and so breaking the expected JSON format.
Use a browser dev tool to examine this network response.
 
Usually this is an error message or warning returned in the network response and so breaking the expected JSON format.
Use a browser dev tool to examine this network response.
I'm still having issues building a search form. I built it from scratch many time and I keep getting the same error
SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data
 
I did and I got the error below in the console:

Undefined variable: id in ../plugins/fabrik_form/redirect/redirect.php

Any idea?
Thanks
 
Usually there should be a line number, too.
I assume it's line 402
$app->setUserState($key, $id);

You can try to comment this out.
 
Should be fixed in github:

https://github.com/Fabrik/fabrik/commit/d9e2d97c0ebc78f487d8b49a1e2769c1eb89d70b

Also ... this is one of the reasons you need to keep PHP error reporting turned off, unless you are actually needing to debug PHP. Otherwise what would usually be harmless PHP warnings and notices can get tossed into JSON responses, and blow the Javascript AJAX call processing up.

-- hugh
Followed the above and I got a new error:

Notice: Use of undefined constant id - assumed 'id' in ../plugins/fabrik_form/redirect/redirect.php on line 403

Warning: Attempt to assign property of non-object in ../libraries/joomla/registry/registry.php on line 336
 
Ooops, yeah, this is 3.0.9. Troester is right, just get rid of that line.

https://github.com/Fabrik/fabrik/commit/74558214d910d960890fcb80bd718178ef12dadf

-- hugh
Same :(

Warning: Attempt to assign property of non-object in ../libraries/joomla/registry/registry.php on line 336

Notice: Trying to get property of non-object in ../libraries/joomla/registry/registry.php on line 338

Warning: Attempt to assign property of non-object in ../libraries/joomla/registry/registry.php on line 336

Notice: Trying to get property of non-object in .../libraries/joomla/registry/registry.php on line 338
 
I'll set up a test when I get some time. Meanwhile, just turn PHP error reporting off in J!'s global settings.

-- hugh
 
And now it gets redirect to:

getData:Unknown column 'tablename.id' in 'field list' SQL=SELECT SQL_CALC_FOUND_ROWS DISTINCT
 
Notice: Use of undefined constant id - assumed 'id' in ../plugins/fabrik_form/redirect/redirect.php on line 403
Did you do a GitHub update or did you try to add the fix manually? I can't see why it should try to handle a constant in
$formModel->get('id') (which is used in the line above, too)
 
I did get the update as recommended and still getting:
Warning: Attempt to assign property of non-object in ../libraries/joomla/registry/registry.php on line 336
Notice: Trying to get property of non-object in ../libraries/joomla/registry/registry.php on line 338

I fixed it manually. You recommend I should get the update?
 
I can't replicate at all on my old J!2.5 test site

You have a redirect plugin with "use as search data"=yes?
Which exact Joomla version?
Which exact php version?

This is Joomla 2.5 which had it's end of life 10 months ago (and so in principle Fabrik3.0.9)
 
I can't replicate at all on my old J!2.5 test site

You have a redirect plugin with "use as search data"=yes?
Which exact Joomla version?
Which exact php version?

This is Joomla 2.5 which had it's end of life 10 months ago (and so in principle Fabrik3.0.9)

Yes, It's set to yes
Joomla 2.5.28
php version 5.3.10

With no plans to upgrade Joomla or php till summer this means that I won't be able to have a search form on my site? I used to have it working with the same configuration before.
Please advice.
Thanks
 
I used to have it working with the same configuration before.
If it was working at your site there must be a difference to your settings.
As Hugh said you should turn error reporting off, especially if you are using ajaxfied forms, content plugin etc.
Every warning/notice will break the JSON.

I can't replicate your errors/warnings/notices with and without the fix (but I don't have a test site which such an old PHP version).
 
At the risk of stating the obvious, that's the problem with running end-of-lifed, unsupported versions of free software, is it's hard to get support and fix things when they do go wrong.

I've tested the plugin here and don't get those warnings, so it's hard to know what the problem is.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top