Fixed some bugs in the profile setting stuff
This commit is contained in:
parent
12c10d56fe
commit
c98308af17
2 changed files with 4 additions and 2 deletions
|
|
@ -334,9 +334,8 @@ sub www_editProfileFieldSave {
|
|||
my $categoryId = $session->form->selectBox("profileCategoryId");
|
||||
if ($session->form->process("new")) {
|
||||
my $field = WebGUI::ProfileField->create($session,$session->form->text("fid"), \%data, $categoryId);
|
||||
$session->stow->set("editSavedFid",$field->getId);
|
||||
} else {
|
||||
my $field = WebGUI::ProfileField->new($session,$session->stow->get("editSavedFid"));
|
||||
my $field = WebGUI::ProfileField->new($session, $session->form->process("fid"));
|
||||
$field->set(\%data);
|
||||
$field->setCategory($categoryId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -543,6 +543,9 @@ sub setCategory {
|
|||
my $categoryId = shift;
|
||||
return undef unless ($categoryId);
|
||||
my $currentCategoryId = $self->get("profileCategoryId");
|
||||
|
||||
return undef if ($categoryId eq $currentCategoryId);
|
||||
|
||||
my ($sequenceNumber) = $self->session->db->quickArray("select max(sequenceNumber) from userProfileField where profileCategoryId=".$self->session->db->quote($categoryId));
|
||||
$self->session->db->setRow("userProfileField","fieldName",{fieldName=>$self->getId, profileCategoryId=>$categoryId, sequenceNumber=>$sequenceNumber+1});
|
||||
$self->{_property}{profileCategoryId} = $categoryId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue