Hello all,
I'm new to gallery and I'm trying to add new fields to the registration module.
I added the needed fields to the template, db and classes.
Everything works fine and shows in my registration form, but when I'm trying to activate the account,
I'm getting a php error which says that I'm using undefined method.
I defined the method in GalleryPendingUser.class as follows:
Quote:
/**
* The User's gender
*
* @g2 <member>
* @g2 <member-name>gender</member-name>
* @g2 <member-type>STRING</member-type>
* @g2 <member-size>MEDIUM</member-size>
* @g2 <member-external-access>FULL</member-external-access>
* @g2 </member>
*
* @var string $gender
* @access public
*/
var $gender;
/**
* The User's birthdate
*
* @g2 <member>
* @g2 <member-name>birthdate</member-name>
* @g2 <member-type>STRING</member-type>
* @g2 <member-size>MEDIUM</member-size>
* @g2 <member-external-access>FULL</member-external-access>
* @g2 </member>
*
* @var string $birthdate
* @access public
*/
var $birthdate;
Quote:
function getGender() {
return $this->gender;
}
function setGender($gender) {
$this->gender = $gender;
}
function setBirthdate($birthdate) {
$this->birthdate = $birthdate;
}
function getBirthdate() {
return $this->birthdate;
}
The line that throws that error is in GalleryPendingUserHelper.class:
Quote:
/* Copy all values to the new "real" user */
$user->setEmail($pendingUser->getEmail());
$user->setFullName($pendingUser->getFullName());
$user->setGender($pendingUser->getGender()); // This is the first line that throws the error
$user->setBirthdate($pendingUser->getBirthdate());
$user->setLanguage($pendingUser->getLanguage());
$user->setHashedPassword($pendingUser->getHashedPassword());
The user is being added to the pendingUsers table successfully, but when I'm trying to activate it I'm getting this error.
I reinstalled the registration plug in to make sure everything is compiled.
What am I missing?
Thanks in advance,
Mayan
p.s.
I tried using userdata module but it's not doing what I'm looking for.
Posts: 6
I managed to solve this issue, but now the user is added successfully, but the additional fields don't get the new values in the users table (though I can see them in the pending users table...)
Any ideas?
Posts: 6
I finally understood that if I add fields to an entity, I need to reinstall gallery to create all needed parts in db, etc.
Thanks anyway.
Posts: 177
is this not the same thing?
http://codex.gallery2.org/Gallery2:Modules:userdata
Posts: 6
No, because as I understand it only allows to add fields in a separate page and not in the same registration page.
Mayan