fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-11-16 12:54 pm

[dw-free] intermittent error while previewing custom-locked entry with new update page

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

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

Don't use BML::... functions in the Entry controller.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/DW/Controller/Entry.pm
  • views/entry-preview.tt
--------------------------------------------------------------------------------
diff -r 9eef598d2796 -r 80e149a79b7f cgi-bin/DW/Controller/Entry.pm
--- a/cgi-bin/DW/Controller/Entry.pm	Wed Nov 16 19:56:53 2011 +0800
+++ b/cgi-bin/DW/Controller/Entry.pm	Wed Nov 16 20:56:20 2011 +0800
@@ -921,9 +921,10 @@
 
         my $security = "";
         if ( $form_req->{security} eq "private" ) {
-            $security = BML::fill_template( "securityprivate" );
+            $security = $LJ::Img::img{"security-private"};
         } elsif ( $form_req->{security} eq "usemask" ) {
-            $security = BML::fill_template( "securityprotected" );
+            $security = $form_req->{allowmask} > 1 ? $LJ::Img::img{"security-groups"}
+                                                   : $LJ::Img::img{"security-protected"};
         }
         $vars->{security} = $security;
 
diff -r 9eef598d2796 -r 80e149a79b7f views/entry-preview.tt
--- a/views/entry-preview.tt	Wed Nov 16 19:56:53 2011 +0800
+++ b/views/entry-preview.tt	Wed Nov 16 20:56:20 2011 +0800
@@ -43,7 +43,10 @@
 <div id='entry' class='usercontent' style='margin-left: 30px'>
     [%- currents -%]
 
-    [%- security -%]
+    [%- IF security -%]
+        <img src="[% site.imgroot %][% security.src %]" alt="[% security.alt%]" width="[% security.width %]" height="[% security.height %]" align="absmiddle" />
+    [%- END -%]
+
     <div id='entrysubj'>[% subject %]</div>
     [%- IF security OR subject -%]<br />[%- END -%]
 
--------------------------------------------------------------------------------