Fixed the search function that broke in 7.0.7.

also fixed a user profile problemm
This commit is contained in:
JT Smith 2006-09-26 20:34:59 +00:00
parent 41bd19736c
commit 58b3128a3a
6 changed files with 51 additions and 37 deletions

View file

@ -439,7 +439,10 @@ sub profileField {
$self = shift;
$fieldName = shift;
$value = shift;
die "No such profile field: $fieldName" unless $self->session->db->quickArray("SELECT COUNT(*) FROM userProfileField WHERE fieldName = ?", [$fieldName]);
if (!exists $self->{_profile}{$fieldName} && !$self->session->db->quickArray("SELECT COUNT(*) FROM userProfileField WHERE fieldName = ?", [$fieldName])) {
$self->session->warn("No such profile field: $fieldName");
return undef;
}
if (defined $value) {
$self->uncache;
$self->{_profile}{$fieldName} = $value;