Last modified: 2011-12-25 23:59:05 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 T25960, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23960 - Optional parameters for revision variable magic words
Optional parameters for revision variable magic words
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-14 18:43 UTC by Stuart P. Bentley
Modified: 2011-12-25 23:59 UTC (History)
6 users (show)

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


Attachments

Description Stuart P. Bentley 2010-06-14 18:43:08 UTC
{{REVISIONDAY}}, {{REVISIONDAY2}}, {{REVISIONMONTH}}, {{REVISIONYEAR}}, {{REVISIONTIMESTAMP}}, and {{REVISIONUSER}} should all take an optional parameter to specify those variables for specific revision IDs.

Also, {{REVISIONID}} should take an optional index parameter, so {{REVISIONID:1}} gives the
first revision ID, {{REVISIONID:2}} gives the second, {{REVISIONID:0}} gives
the current revision ID just like {{REVISIONID}}, {{REVISIONID:-1}} gives the
previous revision ID, {{REVISIONID:-2}} gives the ID of the revision before the
previous revision, and so forth. (This would oblivate the need for bug 23427's "FSTREVISIONID" magic word.)
Comment 1 [[kgh]] 2010-08-16 11:29:05 UTC
A brilliant idea. Indeed, this would be very useful.
Comment 2 Tim Starling 2010-12-03 04:50:43 UTC
I think all revision variables should be removed, and none more added. They double the page save time, which can run into tens of seconds on large pages.
Comment 3 [[kgh]] 2010-12-03 14:00:18 UTC
Perhaps it would make sense to move these parameters out of core into an extension. Since I believe that a lot of people are using them this might be a good idea if possible. Sadly I cannot evaluate this.
Comment 4 Bawolff (Brian Wolff) 2010-12-04 06:23:58 UTC
Just wondering, why would this be useful? Personally I can't think of a reason to need the timestamp of a specific revision specified by a specific id. I can see having the info for current revision as useful, but for other revisions?
Comment 5 Stuart P. Bentley 2010-12-04 08:04:16 UTC
(In reply to comment #4)
> Just wondering, why would this be useful? Personally I can't think of a reason
> to need the timestamp of a specific revision specified by a specific id. I can
> see having the info for current revision as useful, but for other revisions?

Say you have a page whose content is reflected elsewhere (such as a wikipage describing a blueprint for a technical system). You can make a template that takes the revision ID of the last revision that was current with the system, which displays a link to that revision and how long ago it was written.
Comment 6 Waldir 2011-04-13 11:57:10 UTC
Another use case is the deletion templates, which could use {{REVISIONUSER:1}} to link directly to the user who created the page so they can be notified.

However, bug 23427 comment #13 indicates that retrieving this info is an expensive operation. If this means that this request will never be implemented, then someone please close this bug as WONTFIX so we can reallocate our hope credits to other items in our wishlists :)
Comment 7 Krinkle 2011-04-13 14:47:44 UTC
See also bug 23427 comment 15. Aside from being expensive, 'what is to be considered the "first" revision' is also an open issue. (timestamp, revision id, hidden/visible, history merges, imports)
Comment 8 Waldir 2011-04-13 17:09:18 UTC
Well, if any of those actions is performed on a page, these revision magic words  could simply return an error (assuming undefined?) if a parameter larger than 0 is passed. {{#iferror:}} can then be used to deal with this. 

In any case, the simpler use cases for the first revision (speedy deletion for instance) usually don't involve such complex page manipulation, so the potential benefit outweighs the edge cases where this would fail.
Comment 9 Bergi 2011-12-25 23:59:05 UTC
If this is going to be implemented, I would stronlgy suppose to make the index parameter a _parameter_ and not a function argument:

 {{REVISON...:[page name]|[relative revision index]}}

as per Bug 6092#c15

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


Navigation
Links