Last modified: 2012-12-31 16:21:18 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 T41433, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39433 - Revision Magic Words breaks Counter function
Revision Magic Words breaks Counter function
Status: UNCONFIRMED
Product: MediaWiki extensions
Classification: Unclassified
Widgets (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-16 16:38 UTC by Clément Dietschy
Modified: 2012-12-31 16:21 UTC (History)
2 users (show)

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


Attachments

Description Clément Dietschy 2012-08-16 16:38:04 UTC
On first save, the smarty "counter" function:
<!--{counter name="counter" assign="count"}-->
counts double when the parser meets a revision related magic word:
{{REVISIONID}}
{{REVISIONUSER}}
{{REVISION*}}
...

Ex: The page 'Page' with content:

{{REVISIONUSER}}
{{#widget:Counter}}

where 'Widget:Counter' is:

<!--{counter name="counter" assign="count"}--><!--{$count|default:'empty'}-->

Will display:

UserOfRevision
2

Instead of:

UserOfRevision
1

But after purge, the result becomes correct.

Explanation: when the parser meets a revision related magic word, it sets the 'vary-revision' flags. This flag causes the re-parsing of the page after the revision is saved (once we got the info we want for the magic words). But the counter is not reset between the two parse. Causing it to count 2 times instead of 1.

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


Navigation
Links