From: Emmanuel Lacour Date: Fri, 3 Sep 2010 21:43:07 +0000 (+0200) Subject: Fix crash when there is no UserDetailsAttributes setting X-Git-Tag: 0.02~4 X-Git-Url: http://git.home-dn.net/?p=manu%2FRT-Extension-UserDetails.git;a=commitdiff_plain;h=95e1999c09ad8521365140cce15a12ce3476c633 Fix crash when there is no UserDetailsAttributes setting --- 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