Page MenuHomePhabricator

Increase $wgMaxTemplateDepth (template expansion depth) on Wikispecies
Closed, ResolvedPublicFeature

Description

Hello,

Feature summary (what you would like to be able to do and where):

Increase the template expansion depth on wikispecies ($wgMaxTemplateDepth = 40 ; xdebug.max_nesting_level=100)

The default settings are controlled by $wgMaxTemplateDepth = 40 (on line 4873 here); apparently each wiki has a file LocalSettings.php on the server and you can "tweak the parameters". The guidance for line 4873 reads "Maximum recursion depth for templates within templates. The current parser adds two levels to the PHP call stack for each template, and xdebug limits the call stack to 100 by default. So this should hopefully stop the parser before it hits the xdebug limit." This suggests the limit might be increased (?to say 48?; currently there are pages which involve at least 43 templates).

According to this discussion, it may also be possible to increase the xdebug limit in the php.ini configuration file, by amending to: xdebug.max_nesting_level=200

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

To solve/increase the current limitation on the number of clades/nested templates that can be used.

On wikispecies, as discussed here, there is a current issue with expansion depth. The page Anas formosa (and 2000+ others) display that they are in Category:Pages where expansion depth is exceeded (although functionality otherwise is not obviously affected). Other relevant cladi/templates for this page might include eg Avialae (which suggests a significant and arbitrary truncation in the number of relevant templates invoked), and perhaps Pangalloanserae. There are other well established clades, such as Neoaves, the insertion of which among the templates for other birds is likely to place thousands of other pages in this Category.

Benefits (why should this be implemented?):

To enable better representation of the tree of life.

Thank you

Event Timeline

Aklapper renamed this task from Wikispecies - templates - expansion depth - $wgMaxTemplateDepth - local settings to Increase $wgMaxTemplateDepth (template expansion depth) on Wikispecies.Oct 16 2021, 11:59 AM
Aklapper updated the task description. (Show Details)

Looking at https://noc.wikimedia.org/conf/InitialiseSettings.php.txt and https://noc.wikimedia.org/conf/CommonSettings.php.txt which are the settings for the Wikimedia wikis (in contrast to the default settings of the MediaWiki software), it looks like there is no concept of individual per-wiki configurations yet.

dpifke subscribed.

We (performance team) need to do some evaluation of the impact of this, and are hesitant to make such a change before the holidays.

We will revisit towards the beginning of January.

Change 753867 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] Increase template depth limit to 100

https://gerrit.wikimedia.org/r/753867

Change 753867 merged by jenkins-bot:

[mediawiki/core@master] Increase template depth limit to 100

https://gerrit.wikimedia.org/r/753867

tstarling claimed this task.