Fixed some bugs in the profile setting stuff

This commit is contained in:
Martin Kamerbeek 2006-05-03 15:08:55 +00:00
parent 12c10d56fe
commit c98308af17
2 changed files with 4 additions and 2 deletions

View file

@ -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;