Page MenuHomePhabricator

Show a warning about template loops in edit preview
Closed, ResolvedPublic

Description

This error should generate an error message at the site of the error, at least in Preview mode, so that editors have a fighting chance of finding (or at least being able to report) the problem.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 4 2017, 2:01 PM
IKhitron added a subscriber: IKhitron.

It seems there is already such a warning shown, from the 'parser-template-loop-warning' message: "Template loop detected: [[$1]]"?

Jonesey95 added a comment.EditedApr 6 2017, 5:22 AM

It seems there is already such a warning shown, from the 'parser-template-loop-warning' message: "Template loop detected: [[$1]]"?

Where is the error message displayed in this page?

It seems there is already such a warning shown, from the 'parser-template-loop-warning' message: "Template loop detected: [[$1]]"?

Where is the error message displayed in this page?

The page itself is transcluded inside #expr, the error message is not shown. Have seen the same an dewiki, where the template transclusion was part of a #ifeq and therefor the text was not shown. Was hard to find the issue.

Change 359385 had a related patch set uploaded (by Matěj Suchánek; owner: Matěj Suchánek):
[mediawiki/core@master] Show a warning in edit preview when a template loop is detected

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

Jarekt added a subscriber: Jarekt.Sep 11 2017, 3:05 PM

I just noticed that all Commons Creator Templates are being added to Category:Pages with template loops. Is there some issue with the Module:Creator used by all of them or is there some issue with incorrect categorization?

I would say it's somewhere deeper since institutions get them as well. If it's a new problem, these edits may be problematic.

I do not know if it is a new problem or an issue we had for months. I just noticed it today. I understood template loops in the days of just templates. Now many templates are Lua based. What lua related conditions have to be met to trigger addition of this category? Are there any ways to figure out what triggers it?

I just noticed that c:Template:LangSwitch is included, and last Friday I made very large change to c:Module:Fallback: removing many frame:preprocess calls and switching to use standard MediaWiki fallback chain instead of commons-only fallback chain. Would some changes there trigger it?

IKhitron added a comment.EditedSep 11 2017, 4:18 PM

I do not know if it is a new problem or an issue we had for months.

You can check the inclusion to the category dates.

You can check the inclusion to the category dates.

I do not know how to do it. An SQL query or some tool in Special:SpecialPages?

Earliest date seem to be from 2017-09-08, the day I changed Module:Fallback, and Template:LangSwitch only uses that module. So most likely that code is the problem. The code is also very simple now. Anything there that looks like might be causing the issue?

Change 359385 merged by jenkins-bot:
[mediawiki/core@master] Show a warning in edit preview when a template loop is detected

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

IKhitron added a comment.EditedSep 11 2017, 6:32 PM

Finally :-)

matmarex closed this task as Resolved.Sep 11 2017, 6:35 PM
matmarex removed a project: Patch-For-Review.

Whatever the issue with Commons's 'Creator' template is, it's not really related to this task (other than the new error message possibly making it easier to find the problem). The code will go live this week per the usual schedule, it should be deployed to Commons on Wednesday.

OK, I will create new task, If it is still an issue and I can not figure it out after the the deployment.

(As a side note, when looking into this, I found a fascinating Chrome bug that affects the rendering of Template:Creator on Commons: https://bugs.chromium.org/p/chromium/issues/detail?id=764031)