<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bug-reports</title><link href="https://sourceforge.net/p/dotiac/bug-reports/" rel="alternate"/><link href="https://sourceforge.net/p/dotiac/bug-reports/feed.atom" rel="self"/><id>https://sourceforge.net/p/dotiac/bug-reports/</id><updated>2010-09-06T16:12:37Z</updated><subtitle>Recent changes to bug-reports</subtitle><entry><title>include/extend tags are relative from the current template</title><link href="https://sourceforge.net/p/dotiac/bug-reports/6/" rel="alternate"/><published>2010-09-06T16:12:37Z</published><updated>2010-09-06T16:12:37Z</updated><author><name>Ben</name><uri>https://sourceforge.net/u/bennact/</uri></author><id>https://sourceforge.net2f6d148d1f0d5b120e2d70497a82c4bd201a7118</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I found this bug by using the extend tag, but assuming it also effects include tag.&lt;/p&gt;
&lt;p&gt;When passing the file path to the extend tag, the path is always relative to the template that is currently being processed. This is problematic when rendering templates within sub directories of the template directory.&lt;/p&gt;
&lt;p&gt;An example&lt;br /&gt;
Consider the following directory structure:&lt;br /&gt;
- Templates&lt;br /&gt;
|-&amp;gt; layouts&lt;br /&gt;
|  main.html&lt;br /&gt;
|-&amp;gt; blog&lt;br /&gt;
|   entries.html&lt;br /&gt;
`&amp;gt; home.html&lt;/p&gt;
&lt;p&gt;When using Dotiac to parse home.html, home.html could use the extends tag to extend layouts/main.html:&lt;/p&gt;
&lt;p&gt;{% extends "layouts/main.html" %}&lt;/p&gt;
&lt;p&gt;However if you try and do this within blog/entries.html, it will not work because it will in fact try to use blog/layouts/main.html, which does not exist. In django the tags extend and include lookup the paths that they are passed relative to the template directories configured in TEMPLATE_DIRS. This list of directories could be @Dotiac::DTL::TEMPLATE_DIRS, since this is already used when using Dotiac in a django fashion (exported Template and Context).&lt;/p&gt;
&lt;p&gt;I have included a svn diff of the changes I have made locally and the test I wrote for it in the hope it helps.&lt;/p&gt;
&lt;p&gt;Some background:&lt;br /&gt;
I discovered this bug while trying to write a Dotiac renderer for Mojolicious. Mojolicious uses a single directory to store templates, which are typically organised in subfolders for each controller, which inherit from other templates. Currently this is (the simplified) version of that code:&lt;/p&gt;
&lt;p&gt;@Dotiac::DTL::TEMPLATE_DIRS = $config{template_paths};&lt;br /&gt;
my $template = Dotiac::DTL::Template($template_name);&lt;br /&gt;
my $context = Dotiac::DTL::Context({%{$c-&amp;gt;stash}, c =&amp;gt; $c, h =&amp;gt; $helper});&lt;br /&gt;
$$output = $template-&amp;gt;render($context);&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Dokumentation Bug</title><link href="https://sourceforge.net/p/dotiac/bug-reports/5/" rel="alternate"/><published>2010-01-11T11:24:40Z</published><updated>2010-01-11T11:24:40Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netca4bbaa791a2787cfb1aea0c78461af78065878e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In section Extension of Dotiac::DTL -&amp;gt; Filters of the main pod the example uses the old syntax.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>get_variables() with multiple empty keywords</title><link href="https://sourceforge.net/p/dotiac/bug-reports/4/" rel="alternate"/><published>2009-02-05T18:42:15Z</published><updated>2009-02-05T18:42:15Z</updated><author><name>Maluku</name><uri>https://sourceforge.net/u/maluku/</uri></author><id>https://sourceforge.net4155afdae5c2885fefb25d795212868caaf0025c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;get_variables() does not work right on multiple allowed empty keywords:&lt;/p&gt;
&lt;p&gt;{Dotiac::DTL::get_variables("loop foo bar","bar","foo");}&lt;br /&gt;
is &lt;br /&gt;
{&lt;br /&gt;
"" =&amp;gt; [&lt;br /&gt;
"loop"&lt;br /&gt;
],&lt;br /&gt;
"foo" =&amp;gt; [&lt;br /&gt;
"bar"&lt;br /&gt;
]&lt;br /&gt;
};&lt;br /&gt;
not &lt;br /&gt;
{&lt;br /&gt;
"" =&amp;gt; [&lt;br /&gt;
"loop"&lt;br /&gt;
],&lt;br /&gt;
"foo" =&amp;gt; [],&lt;br /&gt;
"bar" = &amp;gt; []         &lt;br /&gt;
};&lt;br /&gt;
as it should be.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Does not work with perl 5.6.2</title><link href="https://sourceforge.net/p/dotiac/bug-reports/3/" rel="alternate"/><published>2009-01-19T00:19:22Z</published><updated>2009-01-19T00:19:22Z</updated><author><name>Maluku</name><uri>https://sourceforge.net/u/maluku/</uri></author><id>https://sourceforge.net74634e80aead66356ff3058028673674b824b1dc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Fails for various reasons, most of which got to do with time related stuff or wrong modules loaded.&lt;/p&gt;
&lt;p&gt;See CPAN-testers&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>get_variables() warns on undef</title><link href="https://sourceforge.net/p/dotiac/bug-reports/2/" rel="alternate"/><published>2009-01-16T23:24:20Z</published><updated>2009-01-16T23:24:20Z</updated><author><name>Maluku</name><uri>https://sourceforge.net/u/maluku/</uri></author><id>https://sourceforge.net69e82687b4d89633fc59b1bd935955e71b7fc988</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;get_variables() should check for undef as $x, otherwise it will generate useless warnings.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>$escape in filter.pm</title><link href="https://sourceforge.net/p/dotiac/bug-reports/1/" rel="alternate"/><published>2009-01-16T23:03:38Z</published><updated>2009-01-16T23:03:38Z</updated><author><name>Maluku</name><uri>https://sourceforge.net/u/maluku/</uri></author><id>https://sourceforge.net3ac797e4bf47411f31b806b86c4e2a0a7702a877</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;$escape is used instead of a 0 for the autoescape status in filter.pm's print() and string(), but the template-content should always be safe.&lt;/p&gt;
&lt;p&gt;It's done right in perlprint() and perlstring()&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>