Page MenuHomePhabricator

Create non-expensive variable version of {{PAGESIZE}} for current page, and let it get the correct size of the current page when previewing and saving
Open, LowPublicFeature

Description

Author: Amalthea.wikimedia

Description:
The PAGESIZE parser function should also work as a magic word with no parameters, {{PAGESIZE}}. In such a case, it should not count as an expensive parser function, and it should return the size of the page that is currently saved, not the size as it was before. The current workaround {{PAGESIZE:{{FULLPAGENAME}}}} is expensive and retrieves the old pagesize from the db, which will usually not be the intended functionality, and needs a purge to return the current size.

It would be perfect if the parser function behaved like that, too, when applied to {{FULLPAGENAME}}, for consistency at least, but I think one could live with the current behaviour there.


Version: unspecified
Severity: enhancement

Details

Reference
bz18703

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:33 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz18703.
bzimport added a subscriber: Unknown Object (MLST).

herd wrote:

Updating summary a bit.

Also (per r49575 and such) please consider renaming this to {{REVISIONSIZE}} (variable) and {{REVISIONSIZE:}} (parserfunction) with {{PAGESIZE:}} (parserfunction) as a legacy alias.

A variable {{REVISIONSIZE}} was added with gerrit 82650

Amalthea.wikimedia wrote:

Functionality is now as requested, but what Splarka wrote in comment #1 is still valid: REVISIONUSER (for example) works as both a magic word and an (expensive) parser function, but for page size you need to use REVISIONSIZE for the current page and PAGESIZE as the (expensive) parser function.
That should be straightened out at some point.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:01 AM
Aklapper removed a subscriber: wikibugs-l-list.