diff options
author | Joey Hess <joey@kitenet.net> | 2010-11-27 23:29:23 +0000 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-11-27 23:29:23 +0000 |
commit | 3650d0265bc501219bc6d5cd4fa91a6b6ecd793a (patch) | |
tree | bc69471b66086744218a6f402d6f055eca037de0 /doc/recentchanges/change_53e519931f3a6b7cea0af652d749344757d4e2bc._change | |
parent | 6e97574598534c4d81d2039bc044ceceaaf44fbd (diff) |
Diffstat (limited to 'doc/recentchanges/change_53e519931f3a6b7cea0af652d749344757d4e2bc._change')
-rw-r--r-- | doc/recentchanges/change_53e519931f3a6b7cea0af652d749344757d4e2bc._change | 112 |
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&do=goto" rel="nofollow">bugs/argument isn't numeric: mixing templates and creation_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&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 "\x{3c}\x{54}..." isn't numeric in numeric eq (==) at /usr/share/perl5/IkiWiki.pm line 2547. ++ Argument "\x{3c}\x{54}..." isn'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()}))[5] + 1900 == shift) { <-- this one ++ return IkiWiki::SuccessReason->new('creation_year matched'); ++ } ++ ++A git bisect shows that the offending commit introduced this hunk ++ ++ ++ --- /dev/null ++ +++ b/templates/all_entry.mdwn ++ @@ -0,0 +1,23 @@ ++ +## <TMPL_VAR year> ++ + ++ +There ++ +<TMPL_IF current> ++ +have been ++ +<TMPL_ELSE> ++ +were ++ +</TMPL_IF> ++ +[[!pagecount pages=" ++ +log/* and !tagged(aggregation) and !*/Discussion and !tagged(draft) ++ +and creation_year(<TMPL_VAR year>) ++ +and !*.png and !*.jpg ++ +"]] posts ++ +<TMPL_IF current> ++ +so far ++ +</TMPL_IF> ++ +in <TMPL_VAR year>. ++ + ++ +[[!inline pages=" ++ + log/* and !tagged(aggregation) and !*/Discussion and !tagged(draft) ++ + and creation_year(<TMPL_VAR year>) ++ + and !*.png and !*.jpg ++ + " archive=yes feeds=no]] ++ ++The lines which feature creation_year(<TMPL_VAR year>) 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. ++ ++ \[[!template id=all_entry.tmpl year=2010 current=true]] ++ ++An alternative fix is to wrap the entire template inside a test to see whether the page is included or not. E.g. ++ ++ ++ \[[!if test="included()" then=""" ++ ...template... ++ """ else=""" ++ Nothing to see here. ++ """]] ++ ++In fact, this is probably best practice for in-srcdir templates. I'd consider this done if the documentation for the directive suggested it. -- [[Jon]] + +</pre> +</div> + +<!-- 53e519931f3a6b7cea0af652d749344757d4e2bc --> |