mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-06-12 08:49 pm

[dw-free] Error if you try to use the customize interface but don't have a layout layer defined

[commit: http://hg.dwscoalition.org/dw-free/rev/bbe1e7bc106f]

http://bugs.dwscoalition.org/show_bug.cgi?id=880

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

Patch by [personal profile] afuna.

Files modified:
  • cgi-bin/LJ/Customize.pm
--------------------------------------------------------------------------------
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;
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org