× Joomla Facebook Connect support forum

Topic-icon Profile Mapping does not work with drop-down fields

Active Subscriptions:

None
Hi there,

I have tried to map Jomsocial profile fields with Facebook and noticed that Drop-down type fields do not appear in the mapping page.

To get gender information imported from Facebook I had to change the field type from drop-down to textbox which means that users joining my site with their e-mail will have to type in their gender manually (male or female).

This is not acceptable and I think there should be a way to map this field even though it is a drop-down.

The same goes for the birthday. I had to change it to textbox to get it imported.

Even Jomsocial standard Facebook integration does this.

I look forward to the solution.

Thanks
The topic has been locked.
Support Specialist
14 years 4 months ago #18014 by alzander
For birthdate, if you have the field type set to "Date" that should allow you to select it in the import area. That functionality has been tested extensively and you shouldn't have issues there.

For the gender field, it's a little more difficult as Facebook only returns "male" or "female" If you're using those exact options in your drop-down, then we can easily help you add those as options to map to. If you're using something else, then it's much more difficult as the string imported will still be "male" or "female" which won't align with any available options from your drop-down. To allow mappings into "select" type fields, you'll need to make a minor modification to the JomSocial Profile Plugin. In the /plugins/jfbcprofiles/jomsocial.php file, you'll need to update line 429 from:
$query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" ORDER BY ordering';
to (adding the OR type="select")
$query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" OR type="select" ORDER BY ordering';

For the 4.2 release, we're planning to have a revamped Profile system which should make customized mappings easier into special fields, like gender. Until then, hope the above helps.

Thanks,
Alex
The topic has been locked.