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:
I am running JFBConnect-4.3-Joomla15_20130104
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!
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?
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';
$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';
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,
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,