By BinYaprak on Monday, 08 August 2016
Posted in Technical Issues
Replies 1
Likes 0
Views 326
Votes 0
Can we use same UNIQUE KEY more than once? (for same type customfield)

What we want to do is, for example, we will take university info from the user in "1-step" registration.

Later, User can fill other fields in profile edit page but he/she will see University custom field under Education Tab.

If we can duplicate for example a dropdown custom field with its unique key, we can change both fields' view settings so that user can see "university field 1" in registration but cannot see when editing, instead he/she can edit same field on "university field 2" in the education tab.

Which code/file can we modify to make this happen?

Thanks
Hey there,

I am a little bit lost here, do you mean you would like to set multiple custom fields with same (unique key && field type && profile type)? if yes, unfortunately by default system we do not allow user to set same unique name in same profile type and field type. Because some of the fields will use the unique name to check and populate the custom field value.

If you would like to achieve this, you will have edit this file -> JoomlaFolder\administrator\components\com_easysocial\includes\fields\fields.php

// LINE 1043
$field->unique_key = $fieldTable->checkUniqueKey();

// Replace with
$field->unique_key = $fieldTable->unique_key();

·
Tuesday, 09 August 2016 13:16
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post