Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 76605
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: adam.prime [...] utoronto.ca
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.24
Fixed in: (no value)



Subject: Issues with templates that have colon's in the filename
If you attempt to process a template with a colon in the filename, then TT puts you through some code about PREFIX_MAP and different Template::Providers (which is a feature that is very poorly documented). If you have a file with a colon in the name and have no interest in this PREFIX_MAP stuff, there is no way to just turn it off and have everything behave normally. So that's my suggestion. Add a constructor flag that disables the PREFIX_MAP code completely. The attached patch (untested, unlikely to work as is) should illustrate what I mean by that.
Subject: tt.patch
diff --git a/lib/Template/Context.pm b/lib/Template/Context.pm index 7a49f75..d58c98f 100644 --- a/lib/Template/Context.pm +++ b/lib/Template/Context.pm @@ -108,12 +108,15 @@ sub template { # now it's time to ask the providers, so we look to see if any # prefix is specified to indicate the desired provider set. - if ($^O eq 'MSWin32') { - # let C:/foo through - $prefix = $1 if $shortname =~ s/^(\w{2,})://o; - } - else { - $prefix = $1 if $shortname =~ s/^(\w+)://; + + if ($self->{ USE_PREFIX_MAPS }) { + if ($^O eq 'MSWin32') { + # let C:/foo through + $prefix = $1 if $shortname =~ s/^(\w{2,})://o; + } + else { + $prefix = $1 if $shortname =~ s/^(\w+)://; + } } if (defined $prefix) {
Ticket migrated to github as https://github.com/abw/Template2/issues/111