fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-02-07 05:41 am

[dw-free] Add ability for Template Toolkit site-schemes to DW::Template

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

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

Fix not calling __load_data in all places.

Patch by [personal profile] exor674.

Files modified:
  • cgi-bin/DW/SiteScheme.pm
--------------------------------------------------------------------------------
diff -r 7c201868736d -r 38880ee455a1 cgi-bin/DW/SiteScheme.pm
--- a/cgi-bin/DW/SiteScheme.pm	Fri Feb 04 15:04:51 2011 +0800
+++ b/cgi-bin/DW/SiteScheme.pm	Mon Feb 07 13:41:15 2011 +0800
@@ -42,6 +42,8 @@ our @sitescheme_order = ();
 
 sub get {
     my ( $class, $scheme ) = @_;
+    $class->__load_data;
+
     $scheme ||= $class->current;
 
     $scheme = $sitescheme_order[0] unless exists $sitescheme_data{$scheme};
@@ -61,6 +63,8 @@ sub tt_file {
 }
 
 sub engine {
+    $_[0]->__load_data;
+
     return $sitescheme_data{$_[0]->{scheme}}->{engine} || 'tt';
 }
 
@@ -76,7 +80,7 @@ Also works on a DW::SiteScheme object
 
 sub inheritance {
     my ( $self, $scheme ) = @_;
-    DW::SiteScheme->__load_data;
+    $self->__load_data;
 
     $scheme = $self->{scheme} if ref $self;
 
@@ -133,6 +137,7 @@ sub __load_data {
 =cut
 sub available {
     $_[0]->__load_data;
+
     return map { $sitescheme_data{$_} } @sitescheme_order;
 }
 
--------------------------------------------------------------------------------