Permalink
Browse files

*** empty log message ***

git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@64 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information...
1 parent 809502d commit 0f6847960ba48c8ef52b28930f76b6c91e9d40e5 @abw committed Oct 25, 2000
View
23 Changes
@@ -20,13 +20,27 @@
# Version 2.00
#------------------------------------------------------------------------
+* Updated the Makefile.PL to check for external modules, prompt for
+ DBI test parameters, and various other niceties.
+
+* Fixed a bug in the Template::Service module which was using any
+ non-word characters to delimit lists of PRE/POST_PROCESS files.
+ A value such as 'config, header.html' would be interpreted as
+ [ 'config', 'header', 'html' ]. It now uses the DELIMITER value
+ which is ':' by default, e.g. PRE_PROCESS => 'config:header.html'
+ is interpreted as [ 'config', 'header.html' ].
+
* Incorporated the DBI plugin module, written by Simon Matthews. This
features a major reorganisation of the code, fixes a few bugs, removes
some dead wood, and has improved documentation and test script.
* Rewrote the XML::DOM plugin, fixing the memory leakage problems and
adding the toTemplate() method and friends, as provided by Simon
- Matthews.
+ Matthews. Note that it's quite easy to send Perl into a deep
+ recursive loop via the childrenToTemplate() and allChildrenToTemplate()
+ methods due to a misfeature was added by Andy Wardley. This will be
+ fixed in a future release and may result in behavioural changes to
+ these methods. So don't rely on them for now.
* Incorporated the Dumper plugin from Simon Matthews which interfaces to
the Data::Dumper module.
@@ -46,11 +60,16 @@
decided that count() was the better name (shorter and more obvious).
Also changed internal Template::Iterator counter variables to UPPER
CASE to allow AUTOLOAD to be more easily reused by derived iterators
- such as the on for the DBI plugin.
+ such as the one for the DBI plugin.
* Fixed a bug in the Table plugin which caused an "undefined variable..."
warning to be emitted when an empty list was provided.
+* Documented the problem identified by Chris Winters where an IF
+ used as a side-effect to an implied SET directive doesn't behave as
+ expected. A directive of the form [% foo = 'bar' IF condition %]
+ should be written explicitly as [% SET foo = 'bar' IF condition %]
+
#------------------------------------------------------------------------
# Version 2.00 beta 5 14th September 2000
@@ -30,7 +30,6 @@ use strict;
use vars qw( @ISA $VERSION );
use base qw( Template::Plugin );
use Template::Plugin;
-use CGI;
$VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
@@ -29,7 +29,6 @@ require 5.004;
use strict;
use vars qw( @ISA $VERSION );
use Template::Plugin;
-use CGI;
@ISA = qw( Template::Plugin );
$VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
@@ -608,6 +608,9 @@ childrenToTemplate() method with the 'deep' flag set to any true value.
=head1 BUGS
+The childrenToTemplate() and allChildrenToTemplate() methods can easily
+slip into deep recursion.
+
The 'verbose' and 'nospace' options are not documented. They may
change in the near future.
View
@@ -258,8 +258,9 @@ sub _init {
my ($self, $params) = @_;
my $size = $params->{ CACHE_SIZE };
my $path = $params->{ INCLUDE_PATH } || '.';
- my $dlim = $params->{ DELIMITER } || ':';
my $cdir = $params->{ COMPILE_DIR } || '';
+ my $dlim = $params->{ DELIMITER };
+ $dlim = ':' unless defined $dlim;
# coerce INCLUDE_PATH to an array ref, if not already so
$path = [ split($dlim, $path) ]
View
@@ -140,7 +140,7 @@ sub _init {
foreach $item (qw( PRE_PROCESS PROCESS POST_PROCESS )) {
$data = $config->{ $item };
next unless defined $data;
- $data = [ split(/$delim/, $data || '') ]
+ $data = [ split($delim, $data || '') ]
unless ref $data eq 'ARRAY';
$self->{ $item } = $data;
}
View
@@ -17,7 +17,7 @@
#========================================================================
use strict;
-use lib qw( ../lib );
+use lib qw( ./lib ../lib );
use Template qw( :status );
use Template::Test;
$^W = 1;
View
@@ -30,12 +30,12 @@ my $config = {
my $tt1 = Template->new($config);
$config->{ PRE_PROCESS } = 'config';
-$config->{ PROCESS } = 'header,content';
+$config->{ PROCESS } = 'header:content';
$config->{ POST_PROCESS } = 'footer';
$config->{ TRIM } = 0;
my $tt2 = Template->new($config);
-$config->{ PRE_PROCESS } = 'config,header';
+$config->{ PRE_PROCESS } = 'config:header.tt2';
$config->{ PROCESS } = '';
my $tt3 = Template->new($config);
@@ -81,7 +81,7 @@ footer
[% META title = 'Test 3' -%]
This is the third test
-- expect --
-header:
+header.tt2:
title: Joe Random Title
menu: This is the menu, defined in 'config'
footer
View
@@ -0,0 +1,3 @@
+header.tt2:
+ title: [% title %]
+ menu: [% INCLUDE menu %]

0 comments on commit 0f68479

Please sign in to comment.