Last modified: 2013-04-08 14:12:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T27644, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25644 - Error: Template loop detected - limited recursions should be allowed.
Error: Template loop detected - limited recursions should be allowed.
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
1.17.x
All All
: Lowest enhancement with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: newparser, parser, testme
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-25 10:18 UTC by Purodha Blissenbach
Modified: 2013-04-08 14:12 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Purodha Blissenbach 2010-10-25 10:18:04 UTC
In a private Wiki. I made a simple template having 10 parameters.
With Extension:Parserfunctions, it tests the wiki page given as
its 1st parameter:
- if omitted or empty, the template does nothing, else
- if the pages exists, it yields a (blue) link to it, else
- if emits a (red) link and calls itself recursively with
  parameters shifted one down.

Called at the end of wiki pages, it allow one to see which
other consecutive pages are planned but not created, and to
continue reading at the next existing page. This appears
sane, imho, especially, since 10 is not a large number.

I declines work however, saying "template loop detected"

Of course, you can always "flatten" a known (max) number
of recusions, but the result is an awfully huge template,
with many duplicated lines of code.

Is there a chance to have a $wgTemplateLoopLimit installation
setting which would make MediaWiki more flexible?

I would naively recommend a default $wgTemplateLoopLimit = 2 
so as to accomodate templates that document themselves with
sample calls.

If that can be had without restructuring or rewriting the parser,
I might give it a try myself.
Comment 1 Mark A. Hershberger 2011-04-01 21:24:37 UTC
(In reply to comment #0)
> If that can be had without restructuring or rewriting the parser,
> I might give it a try myself.

Did you give it a try?  Also, don't fear the parser! ;)
Comment 2 Purodha Blissenbach 2011-05-10 20:51:44 UTC
I did not have the time to look into it yet, but maybe it is an option to do so during the upcoming Hackaton :-) where all the experts are about.
Comment 3 Helder 2012-03-10 13:40:04 UTC
We should be able to get the value of "{{Factorial|2}}" by using a template such as the following [[Template:Factorial]]:
----
{{#ifexpr: {{{1|0}}} < 2
 |1
 |{{Factorial|
  {{#expr: {{{1}}}
   *{{Factorial|
     {{#expr: {{{1}}} - 1 }}
    }}
  }}
 }}
}}
----
Currently, all we get is "Template loop detected" =(
Comment 4 Helder 2012-03-10 13:42:17 UTC
Maybe the new parser could handle this? (adding "newparser" keyword)
Comment 5 Andre Klapper 2013-04-08 12:51:54 UTC
Unsure if this request (adding a $wgTemplateLoopLimit setting) still makes sense now that we have Lua/Scribunto which makes template execution way faster, hence proposing WONTFIX here.

http://en.wikipedia.org/wiki/Wikipedia:Template_limits#How_can_you_find_out.3F explains how to find out if limitations are set (and I assume this applies to any wiki, not just Wikimedia ones).

If you have questions about Lua, please post on http://en.wikipedia.org/wiki/Wikipedia_talk:Lua , and see http://www.mediawiki.org/wiki/Lua_scripting and http://blog.wikimedia.org/tag/lua/ for more information.
Comment 6 Brad Jorsch 2013-04-08 14:12:42 UTC
(In reply to comment #5)
> Unsure if this request (adding a $wgTemplateLoopLimit setting) still makes
> sense now that we have Lua/Scribunto which makes template execution way
> faster, hence proposing WONTFIX here.

Scribunto is not only faster, it also has looping constructs, and much cleaner syntax for this sort of thing. WONTFIX sounds good to me.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links