Fix error when layout layer is deleted but the style still is defined.

        Patch by afuna. 

diffs (18 lines):

diff -r 64f05824a80e -r bbe1e7bc106f cgi-bin/LJ/Customize.pm
--- a/cgi-bin/LJ/Customize.pm   Fri Jun 12 20:46:06 2009 +0000
+++ b/cgi-bin/LJ/Customize.pm   Fri Jun 12 20:49:28 2009 +0000
@@ -87,6 +87,14 @@ sub verify_and_load_style {
     my $u = shift;
 
     my $style = LJ::S2::load_style($u->prop('s2_style'));
+
+    unless ( $style && $style->{layer}->{layout} ) {
+        # we have no layout layer for this style, which causes errors in
+        # the customization interface
+        # undef current style and force them to use the site defaults
+        $u->set_prop( s2_style => 0 );
+        $style = undef;
+    }
 
     unless ($style && $style->{'userid'} == $u->{'userid'}) {
         my $theme;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to