summaryrefslogtreecommitdiff
path: root/doc/recentchanges/change_53e519931f3a6b7cea0af652d749344757d4e2bc._change
diff options
context:
space:
mode:
Diffstat (limited to 'doc/recentchanges/change_53e519931f3a6b7cea0af652d749344757d4e2bc._change')
-rw-r--r--doc/recentchanges/change_53e519931f3a6b7cea0af652d749344757d4e2bc._change112
1 files changed, 112 insertions, 0 deletions
diff --git a/doc/recentchanges/change_53e519931f3a6b7cea0af652d749344757d4e2bc._change b/doc/recentchanges/change_53e519931f3a6b7cea0af652d749344757d4e2bc._change
new file mode 100644
index 000000000..05105eacc
--- /dev/null
+++ b/doc/recentchanges/change_53e519931f3a6b7cea0af652d749344757d4e2bc._change
@@ -0,0 +1,112 @@
+[[!meta author="""http://jmtd.livejournal.com/"""]]
+
+[[!meta authorurl="""http://jmtd.livejournal.com/"""]]
+
+[[!meta title="""change to bugs/argument_isn__39__t_numeric:_mixing_templates_and_creation__95__date on ikiwiki"""]]
+
+[[!meta permalink="http://ikiwiki.info/recentchanges/#change-53e519931f3a6b7cea0af652d749344757d4e2bc"]]
+
+<div id="change-53e519931f3a6b7cea0af652d749344757d4e2bc" class="metadata">
+<span class="desc"><br />Changed pages:</span>
+<span class="pagelinks">
+
+<a href="http://git.ikiwiki.info/?p=ikiwiki;a=blobdiff;f=doc/bugs/argument_isn__39__t_numeric:_mixing_templates_and_creation__95__date.mdwn;h=70af505c124ac6ddb6e987c2625f92629de4690b;hp=0000000000000000000000000000000000000000;hb=53e519931f3a6b7cea0af652d749344757d4e2bc;hpb=5ecba3b05d66bb58dc48a9027838e8b0bcbc0db9" title="diff" rel="nofollow">[[diff|wikiicons/diff.png]]</a><a href="http://ikiwiki.info/ikiwiki.cgi?page=bugs%2Fargument_isn__39__t_numeric%3A_mixing_templates_and_creation__95__date&amp;do=goto" rel="nofollow">bugs/argument isn&#39;t numeric: mixing templates and creation&#95;date</a>
+
+
+</span>
+<span class="desc"><br />Changed by:</span>
+<span class="committer">
+
+<a href="http://jmtd.livejournal.com/" rel="nofollow">jmtd [livejournal.com]</a>
+
+</span>
+<span class="desc"><br />Commit type:</span>
+<span class="committype">web</span>
+<span class="desc"><br />Date:</span>
+<span class="changedate"><span class="relativedate" title="Mon, 15 Nov 2010 10:23:01 -0400">10:23:01 11/15/10</span></span>
+<span class="desc"><br /></span>
+</div>
+
+<span class="revert">
+<a href="http://ikiwiki.info/ikiwiki.cgi?rev=53e519931f3a6b7cea0af652d749344757d4e2bc&amp;do=revert" title="revert" rel="nofollow">[[revert|wikiicons/revert.png]]</a>
+</span>
+
+<div class="changelog">
+
+
+template files being treated as regular pages and the problems that can cause<br />
+
+
+</div>
+
+<div class="diff">
+<pre>
+diff --git a/doc/bugs/argument_isn__39__t_numeric:_mixing_templates_and_creation__95__date.mdwn b/doc/bugs/argument_isn__39__t_numeric:_mixing_templates_and_creation__95__date.mdwn
+new file mode 100644
+index 0000000..70af505
+--- /dev/null
++++ b/doc/bugs/argument_isn__39__t_numeric:_mixing_templates_and_creation__95__date.mdwn
+@@ -0,0 +1,58 @@
++I get the following error when building my wiki
++
++ Argument &quot;\x{3c}\x{54}...&quot; isn&#39;t numeric in numeric eq (==) at /usr/share/perl5/IkiWiki.pm line 2547.
++ Argument &quot;\x{3c}\x{54}...&quot; isn&#39;t numeric in numeric eq (==) at /usr/share/perl5/IkiWiki.pm line 2547.
++
++that line corresponds to
++
++ sub match_creation_year ($$;@) {
++ if ((localtime($IkiWiki::pagectime{shift()}))&#91;5&#93; + 1900 == shift) { &lt;-- this one
++ return IkiWiki::SuccessReason-&gt;new(&#39;creation_year matched&#39;);
++ }
++
++A git bisect shows that the offending commit introduced this hunk
++
++
++ --- /dev/null
++ +++ b/templates/all_entry.mdwn
++ @@ -0,0 +1,23 @@
++ +## &lt;TMPL_VAR year&gt;
++ +
++ +There
++ +&lt;TMPL_IF current&gt;
++ +have been
++ +&lt;TMPL_ELSE&gt;
++ +were
++ +&lt;/TMPL_IF&gt;
++ +&#91;&#91;!pagecount pages=&quot;
++ +log/* and !tagged(aggregation) and !*/Discussion and !tagged(draft)
++ +and creation_year(&lt;TMPL_VAR year&gt;)
++ +and !*.png and !*.jpg
++ +&quot;&#93;&#93; posts
++ +&lt;TMPL_IF current&gt;
++ +so far
++ +&lt;/TMPL_IF&gt;
++ +in &lt;TMPL_VAR year&gt;.
++ +
++ +&#91;&#91;!inline pages=&quot;
++ + log/* and !tagged(aggregation) and !*/Discussion and !tagged(draft)
++ + and creation_year(&lt;TMPL_VAR year&gt;)
++ + and !*.png and !*.jpg
++ + &quot; archive=yes feeds=no&#93;&#93;
++
++The lines which feature creation_year(&lt;TMPL_VAR year&gt;) are most likely the culprits. That would explain why the error was repeated twice, and would tally with the file in `templates/` being rendered, rather than the inclusionists.
++
++A workaround is to move the template outside of the srcdir into the external templates directory and include the file suffix when using it, e.g.
++
++ \&#91;&#91;!template id=all_entry.tmpl year=2010 current=true&#93;&#93;
++
++An alternative fix is to wrap the entire template inside a test to see whether the page is included or not. E.g.
++
++
++ \&#91;&#91;!if test=&quot;included()&quot; then=&quot;&quot;&quot;
++ ...template...
++ &quot;&quot;&quot; else=&quot;&quot;&quot;
++ Nothing to see here.
++ &quot;&quot;&quot;&#93;&#93;
++
++In fact, this is probably best practice for in-srcdir templates. I&#39;d consider this done if the documentation for the directive suggested it. -- &#91;&#91;Jon&#93;&#93;
+
+</pre>
+</div>
+
+<!-- 53e519931f3a6b7cea0af652d749344757d4e2bc -->