× Joomla Facebook Connect support forum

Topic-icon Parser Error

11 years 4 months ago #29047 by chramb1
Parser Error was created by chramb1
There is an error in the case where you have a profile import (say, jomsocial or kunena) enabled and there is no mapping.

This is caused by a call to scProfilesOnFetchData() where the map is empty. This causes a call to fetchProfile() with an empty array in $fields, which then causes the fql.query call to look like SELECT FROM user WHERE uid=XXXXXXXX - (the XXXXXXXX replaced with the appropriate uid). Note that it's SELECT FROM and not SELECT (some list of fields) FROM.

This causes FB to return error 601, Parser error: unexpected 'FROM' at position 8 which then fails the call, since it comes back as an exception.

The call should be abandoned in scProfilesOnFetchData() if $fields is empty after attempting to build it, as there is, then, nothing to import. This should be seen as an automatic success and the next step immediately taken.
The topic has been locked.
Support Specialist
11 years 4 months ago #29054 by alzander
Replied by alzander on topic Parser Error
Christopher,
Thanks so much for the feedback! We've honestly seen that issue before on some users sites, but have never been given any access to see their configuration to be able to understand what's going on. It's so simple now that you mention it and kind of silly we missed it.

This will definitely be fixed in the next release.

Thanks again, sorry for the issue, and best of luck with the site!
Alex
The topic has been locked.
Support Specialist
11 years 3 months ago #29261 by alzander
Replied by alzander on topic Parser Error
Christopher,
Wanted to circle back on this question. The issue was definitely a silly one, and the fix we're implementing in the next release is below. In the /libraries/sourcecoast/profile.php file, in the scProfilesOnFetchData() function, there was the following line directly after fetching the field_map parameter:
if($socialFieldMap == "")
            return;
That is being changed to:
if(empty($socialFieldMap))
            return;
The update will check for an empty array or empty string, which is the desired behavior. At least silly mistakes have easy fixes.

Thanks again. Any input you have is welcome,
Alex
The topic has been locked.
11 years 3 months ago #29278 by chramb1
Replied by chramb1 on topic Parser Error
Excellent.

Yeah, I used to run into this now and again and just got into the habit of using empty() in almost all cases where an explicit check was not otherwise warranted.
The topic has been locked.