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-10-21 06:04 pm

[dw-free] "Other" layerid when editing a style does not stick

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

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

Fix auto-vivification error in public styles hash.

Patch by [personal profile] afuna.

Files modified:
  • htdocs/customize/advanced/styles.bml
--------------------------------------------------------------------------------
diff -r dfc1947a7c78 -r f1430708e8b4 htdocs/customize/advanced/styles.bml
--- a/htdocs/customize/advanced/styles.bml	Wed Oct 21 18:02:28 2009 +0000
+++ b/htdocs/customize/advanced/styles.bml	Wed Oct 21 18:04:43 2009 +0000
@@ -352,7 +352,7 @@
         my $html_select = sub {
             my $dis = scalar(@opts) > 2 ? 0 : 1;
 
-            my $sel = ($lid && ! $pub->{$lid} && ! $ulay->{$lid}) ? "_other" : $lid;
+            my $sel = ( $lid && ! ( $pub->{$lid} && $pub->{$lid}->{s2lid} ) && ! $ulay->{$lid} ) ? "_other" : $lid;
             return [ LJ::html_select({ 'name' => $type, 'id' => "select_$type",
                                        'onChange' => "showOther('$type')",
                                        'selected' => $sel,
@@ -368,7 +368,7 @@
                         $ref->{$_}->{'type'} eq $type &&
                         $ref->{$_}->{'b2lid'} == $b2lid &&
                         (!defined $is_active || $is_active) &&
-                        !$pub->{$_}->{is_internal} && # checking this directly here, as I don't care if the parent layers are internal
+                        ! ( $pub->{$_} && $pub->{$_}->{is_internal} ) && # checking this directly here, as I don't care if the parent layers are internal
                         /^\d+$/
                     } keys %$ref;
         };
@@ -385,7 +385,7 @@
         my $startsize = scalar(@opts);
 
         # add the current layer if it's internal and the user is using it.
-        push @opts, ( $lid, BML::ml('.stylelayers.select.layout.user', {'layername' => $pub->{$lid}->{'name'}, 'id' => $lid}) ) if $lid && $pub->{$lid}->{is_internal};
+        push @opts, ( $lid, BML::ml('.stylelayers.select.layout.user', {'layername' => $pub->{$lid}->{'name'}, 'id' => $lid}) ) if $lid && $pub->{$lid} && $pub->{$lid}->{is_internal};
         push @opts, map { $_, BML::ml('.stylelayers.select.layout.user', {'layername' => $ulay->{$_}->{'name'}, 'id' => $_}) } $greplist->($ulay);
 
         # if we didn't push anything above, remove dividing line
@@ -503,4 +503,4 @@ head<=
 <=head
 body=><?_code return $body; _code?>
 bodyopts=>onLoad="pageload();"
-page?>
\ No newline at end of file
+page?>
--------------------------------------------------------------------------------

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