Hi,
Currently, user affiliation, biography , … are saved in multiple languages in OJS; but, we also want to save localized identification data from Registration page into user_settings table (including first_name,middle_name, last_name).
I used this page in GitHub as a guide, and this is what I have done for data registry, but unfortunately these fields are not saved at all in user_settings table.
By the way, I have no problem for data retrieval if the data is saved correctly ( I manually added some filed to this table for test and it went fine).
The below code is just about FirstName. the other 2 items are the same.
in templates/user/register.tpl:
<\input type="text" id="firstName" name="firstName[{$formLocale|escape}]" value="{$firstName[$formLocale]|escape}" size="20" maxlength="40" class="textField" />
in classes/user/form/RegistrationForm.inc.php:
$user->setFirstName($this->getData('firstName'),null);
in classes/user/PKPUserDAO.inc.php:
function getLocaleFieldNames() {
return parent::getLocaleFieldNames() + array('biography', 'signature', 'gossip', 'affiliation','firstName','middleName','lastName');
}
…
function getFirstName($locale) {
return $this->getData('firstName',$locale);
}
…
function setFirstName($firstName,$locale)
{
return $this->setData('firstName', $firstName,$locale);
}
This code creates an error:
Unknown column 'Array' in database ...
could you please help me overcome this problem?
I am using OJS 2.4.6
Best