Last modified: 2014-09-24 01:10:25 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 T53155, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51155 - Add option to ApiQueryRevisions to do the pre-save transform on rvdifftotext before diffing
Add option to ApiQueryRevisions to do the pre-save transform on rvdifftotext ...
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.22.0
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-11 02:53 UTC by Matt Russell
Modified: 2014-09-24 01:10 UTC (History)
4 users (show)

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


Attachments

Description Matt Russell 2013-07-11 02:53:53 UTC
This feature is in the parse API, allowing you to perform a pre-save transform on the text before parsing it, however it is absent in the parsing part of the query revisions API.

This is useful for things such as AJAX diff previews, where currently you have to do a normal page-reloading preview if you want to see PST things such as subst templates and signatures.
Comment 1 Brad Jorsch 2013-07-11 14:11:55 UTC
As stated, this request doesn't make any sense. The content being parsed by rvparse is what is already saved in the database, so it has already had the pre-save transform done on it before it was saved (hence the name "pre-save transform"). There's no reason to do the PST on it again.

But it seems like what you really want is an option to perform the PST on the text passed to rvdifftotext before doing the diff, which could make a sort of sense. But the option shouldn't be named "rvparsepst" or "rvparseonlypst", it should be named something like "rvdifftotextpst" to associate it with what it applies to. I've taken the liberty of changing the bug title accordingly; if you disagree, feel free to revert and we'll go from there.

Actually doing the PST then should be easy enough, you just need to call $difftocontent->preSaveTransform( ... ) in between creating $difftocontent and handing it off to the difference engine. All this is currently around line 600 of ApiQueryRevisions.php.
Comment 2 Matt Russell 2013-07-11 14:22:50 UTC
Sorry, I was misinterpreting the API docs, difftotext is what I meant. Thanks!
Comment 3 Matt Russell 2014-03-31 08:02:10 UTC
Since no one else has done this yet, I had a go at it and submitted the patch through the uploader.

https://gerrit.wikimedia.org/r/#/c/122327/

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


Navigation
Links