diff --git a/lib/WebGUI/Operation/ProfileSettings.pm b/lib/WebGUI/Operation/ProfileSettings.pm index 605d3133f..b691d04eb 100644 --- a/lib/WebGUI/Operation/ProfileSettings.pm +++ b/lib/WebGUI/Operation/ProfileSettings.pm @@ -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); } diff --git a/lib/WebGUI/ProfileField.pm b/lib/WebGUI/ProfileField.pm index 59a7092e3..dcbbe623c 100644 --- a/lib/WebGUI/ProfileField.pm +++ b/lib/WebGUI/ProfileField.pm @@ -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;