× Joomla Facebook Connect support forum

Topic-icon JomSocial Fields Missing from JFBConnect Profiles Menu

Active Subscriptions:

None
In my JomSocial Custom Profiles, I have fields for First Name, Last Name, Gender, Country, etc.. However, when I try to maps these fields to Facebook fields in the backend using JFBConnect component under Profiles, ALL of the JomSocial Fields don't show up, so I can't map them to Facebook fields. For example the following JomSocial fields are missing: Country and Gender.

My site is:
planethop.com/

I am running JFBConnect-4.3-Joomla15_20130104

File Attachment:


File Attachment:
The topic has been locked.
Support Specialist
You won't normally see drop-downs or other selection type boxes in our Profile Mapping area. The reason is that Facebook's data will most likely not match up with the options you give your users. For gender, I believe Facebook uses "Male" and "Female". So, those would have to be the exact settings you'd offer your users. We're working on a better way to handle gender specifically, since it's (usually) an either or option.

As for country, if you're interested in testing a change that may work for countries, there's a minor code change you can make below. If you edit the /plugins/jfbcprofiles/jomsocial/jomsocial.php file, around line 527, you'll see the following line:
$query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" OR type="birthdate" ORDER BY ordering';
Update that to the following (adding the --OR type="country"--)
$query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" OR type="birthdate" OR type="country" ORDER BY ordering';
That will add the Country field to the Field Map area of JFBConnect Profiles. Then, set the correct Country field from Facebook to import into it. It's likely that the countries from Facebook will 'align' with what JomSocial allows, but there may be some countries that don't work perfectly. However, if you expect the majority of your users to come from the 'major' countries, it will hopefully work as expected. Please, please, please test and let us know how well the field gets imported and if it seems correct with the options available in JomSocial!

Some things to look for are is that Facebook (I believe) will return "United States". I don't know what JomSocial uses, but if it's U.S.A or United States of America, that would look like 2 different countries that your users may be from.

You can add "radio" or "select" to the query above and that will also show your radio or selection drop-downs (for things like Gender), but again, be aware that what imports from Facebook may not be the same as what you offer as options on your site.

Hope that helps, but if you have any questions, just let us know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
The country showed up with your above code changes; but when I tried to get Gender to show up, none of the JomSocial fields showed up in the backend. I suspect it may be my code. I tried the following two queries to also show Gender; but they did not work. Perhaps you can provide me the correct query?
Thanks.

DID NOT WORK:
$query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" OR type="birthdate" OR type="country" OR type=”radio” OR type=”select” ORDER BY ordering';

OR

$query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" OR type="birthdate" OR type="country" OR type=”gender” ORDER BY ordering';
The topic has been locked.
Support Specialist
Not sure why those don't work. Since they are "OR" statements, that shouldn't really limit the results, it should only expand them.

The only thing I notice from your post above is that the quotes around 'radio', 'select' and 'gender' is different than the quotation marks around all of the other field types. Can you check that you added normal quotation marks and not some other mark (or that your editor didn't change them to something else). Hopefully, that's all it is. SQL queries can be very picky about syntax..

Hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
Wow, good catch! That worked. Now I have Gender and Country being imported from Facebook to the JomSocial profile.
Thanks!!
The topic has been locked.
Support Specialist
Awesome! Glad to hear we found the problem and very happy to hear it works now. We're revamping the profile system a bit right now. The functionality will be pretty much the same, but it will make it much easier to add new stuff in the future, which we're excited about.

Thanks for your feedback, and good luck,
Alex
The topic has been locked.