Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[bml] r139: LJSV-1843 (Text string variables are not...

Committer: ailyin
LJSV-1843 (Text string variables are not being filled site-wide)
U   trunk/lib/Apache/BML.pm
Modified: trunk/lib/Apache/BML.pm
===================================================================
--- trunk/lib/Apache/BML.pm	2011-09-08 02:28:36 UTC (rev 138)
+++ trunk/lib/Apache/BML.pm	2011-10-06 10:53:06 UTC (rev 139)
@@ -932,10 +932,10 @@
     # template has no variables or BML tags:
     return $content if index($blockflags, 'S') != -1;
 
-    my $expanded;
-    if ($preparsed) {
-        $expanded = $content;
-    } else {
+    my $noexpand = ( index( $blockflags, 'n' ) != -1 );
+
+    my $expanded = $content;
+    if ( !$preparsed && !$noexpand ) {
         $expanded = parsein($content, \%element);
     }
 
@@ -957,7 +957,7 @@
         pop @{$req->{'BlockStack'}};
     }
 
-    $expanded = parsein($expanded, \%element) if $preparsed;
+    $expanded = parsein($expanded, \%element) if $preparsed && !$noexpand;
     return $expanded;
 }
 
@@ -1008,6 +1008,7 @@
             {
                 $$outref .= $1;
                 $block = uc($2);
+                warn $block if $block eq 'STANDOUT';
                 $data = $4 || "";
 
                 # fast path:  immediate close or simple data (no opening BML).
@@ -1316,9 +1317,17 @@
 sub fill_template
 {
     my ($name, $vars) = @_;
+
     die "Can't use BML::fill_template($name) in non-BML context" unless $Apache::BML::cur_req;
-    return Apache::BML::parsein(${$Apache::BML::cur_req->{'blockref'}->{uc($name)}},
-                                $vars);
+
+    my $bmlcode = Apache::BML::parsein(
+        ${ $Apache::BML::cur_req->{'blockref'}->{ uc $name } },
+        $vars,
+    );
+
+    my $decoded = '';
+    Apache::BML::bml_decode( $Apache::BML::cur_req, \$bmlcode, \$decoded, {} );
+    return $decoded;
 }
 
 sub render_page {

Tags: ailyin, andy, bml, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments