Page MenuHomePhabricator

"Preview mode" parser output gets re-used for page views (affects addWarning and REVISIONID processing)
Closed, ResolvedPublic

Description

mw.addWarning() was added after bug T137900 was fixed. It was intended to be used instead of revisionid, where messages should only be shown in preview mode. This preview functionality is mentioned in the documentation, with the change https://mediawiki.org/wiki/Special:Diff/2386645, and also in comment T137900#2384230.

As can be seen on https://en.wikipedia.org/wiki/German_Air_Force, after Module:Check for unknown parameters was changed to use mw.addWarning, the function does show the warning even when the page is not previewed. mw.addWarning does not work when the warning message which is passed through it contains a div.

Event Timeline

Snaevar created this task.Apr 12 2019, 9:12 PM
Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald TranscriptApr 12 2019, 9:12 PM
JJMC89 updated the task description. (Show Details)Apr 12 2019, 9:21 PM
JJMC89 added a subscriber: Legoktm.
Krinkle renamed this task from mw.addWarning shows in read mode with an div passed through it. to "Preview mode" parser output gets re-used for page views (affects addWarning and REVISIONID processing).Apr 12 2019, 11:43 PM

I believe this is not due to an issue with addWarning(). Rather, it has to do with how the parser output is stored and re-used after the fact.

The problem is also seen through templates that use {{REVISIONID}} to detect preview mode.

In both cases, it can be fixed by purging the page (until the next edit).

Krinkle triaged this task as High priority.Apr 12 2019, 11:45 PM

Change 503537 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@master] Add vary-revision-exist flag to handle {{REVISIONID}} and parser cache

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

Change 503540 had a related patch set uploaded (by Krinkle; owner: Aaron Schulz):
[mediawiki/core@wmf/1.33.0-wmf.25] Add vary-revision-exist flag to handle {{REVISIONID}} and parser cache

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

Krinkle assigned this task to aaron.Apr 13 2019, 12:27 AM
Krinkle raised the priority of this task from High to Unbreak Now!.
Krinkle removed a project: Patch-For-Review.
Krinkle closed this task as Resolved.
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 13 2019, 12:27 AM

Mentioned in SAL (#wikimedia-operations) [2019-04-13T00:32:44Z] <krinkle@deploy1001> Synchronized php-1.33.0-wmf.25/includes/: Idc19cc29764a / T220854 - hot fix (duration: 05m 37s)

Change 503540 merged by jenkins-bot:
[mediawiki/core@wmf/1.33.0-wmf.25] Add vary-revision-exist flag to handle {{REVISIONID}} and parser cache

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

Change 503537 merged by jenkins-bot:
[mediawiki/core@master] Add vary-revision-exist flag to handle {{REVISIONID}} and parser cache

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