[Rt-commit] r6399 - in rt/branches/3.6-RELEASE: . html/Prefs

jesse at bestpractical.com jesse at bestpractical.com
Thu Nov 9 23:41:15 EST 2006


Author: jesse
Date: Thu Nov  9 23:41:15 2006
New Revision: 6399

Modified:
   rt/branches/3.6-RELEASE/   (props changed)
   rt/branches/3.6-RELEASE/html/Elements/MyRT
   rt/branches/3.6-RELEASE/html/Prefs/MyRT.html

Log:
 r44732 at pinglin:  jesse | 2006-11-09 23:41:00 -0500
 * The RT homepage no longer explodes if you upgrade from 3.4. (Error proof the "Portlets" attribute handling)
 


Modified: rt/branches/3.6-RELEASE/html/Elements/MyRT
==============================================================================
--- rt/branches/3.6-RELEASE/html/Elements/MyRT	(original)
+++ rt/branches/3.6-RELEASE/html/Elements/MyRT	Thu Nov  9 23:41:15 2006
@@ -70,9 +70,15 @@
 my %allowed_components = map {$_ => 1} @{$RT::HomepageComponents};
 
 unless (exists $session{'my_rt_portlets'}) {
-    my ($d_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
+    my ($default_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
+    my $portlets; 
+    if ($default_portlets) {
+        $portlets = $default_portlets->Content(); 
+    } else {
+        $portlets = {};
+    }
     my $user = $session{'CurrentUser'}->UserObj;
-    $session{'my_rt_portlets'} = $user->Preferences('HomepageSettings', $d_portlets->Content);
+    $session{'my_rt_portlets'} = $user->Preferences('HomepageSettings', $portlets);
 }
 
 my $portlets = $session{'my_rt_portlets'};

Modified: rt/branches/3.6-RELEASE/html/Prefs/MyRT.html
==============================================================================
--- rt/branches/3.6-RELEASE/html/Prefs/MyRT.html	(original)
+++ rt/branches/3.6-RELEASE/html/Prefs/MyRT.html	Thu Nov  9 23:41:15 2006
@@ -71,10 +71,12 @@
 my $user = $session{'CurrentUser'}->UserObj;
 
 unless (exists $session{'my_rt_portlets'}) {
-    my ($d_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
-    $session{'my_rt_portlets'} = $user->Preferences('HomepageSettings', $d_portlets->Content);
+    my $portlets; 
+    
+    my ($default_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
+    $portlets  = $default_portlets ? $default_portlets->Content  : {};
+    $session{'my_rt_portlets'} = $user->Preferences('HomepageSettings', $portlets);
 }
-
 if ($ARGS{SummaryRows}) {
     $user->SetPreferences('SummaryRows', $ARGS{SummaryRows});
     push @actions, loc ('Preferences saved for [_1].', loc('summary rows'));


More information about the Rt-commit mailing list