Fix auto-vivification error in public styles hash.

        Patch by afuna. 

diffs (37 lines):

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?>
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to