From 95e1999c09ad8521365140cce15a12ce3476c633 Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour Date: Fri, 3 Sep 2010 23:43:07 +0200 Subject: [PATCH] Fix crash when there is no UserDetailsAttributes setting --- html/Elements/ShowUserDetails | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/html/Elements/ShowUserDetails b/html/Elements/ShowUserDetails index 0e756bd..de5cbfe 100644 --- a/html/Elements/ShowUserDetails +++ b/html/Elements/ShowUserDetails @@ -22,8 +22,11 @@ my $url = RT->Config->Get('WebPath') ."/Helpers/Toggle/UserDetails?id=". $id; # Default Attributes to display # SortOrder => { AttributeName => '', # DisplayName => '', } -unless ( RT->Config->Get('UserDetailsAttributes') ) { - RT->Config->Set('UserDetailsAttributes', +my %attributes; +if ( RT->Config->Get('UserDetailsAttributes') ) { + %attributes = RT->Config->Get('UserDetailsAttributes'); +} else { + %attributes = ( 1 => { AttributeName => 'RealName', DisplayName => 'Real Name', }, @@ -32,14 +35,10 @@ unless ( RT->Config->Get('UserDetailsAttributes') ) { }, 3 => { AttributeName => 'Organization', DisplayName => 'Organization', - }, + }, ); } -my %attributes = RT->Config->Get('UserDetailsAttributes'); - - - my $User; # Load User only if needed -- 2.11.0