aboutsummaryrefslogtreecommitdiffstats
path: root/includes/actions/RollbackAction.php
Commit message (Collapse)AuthorAgeFilesLines
...
* Add TransactionProfiler::redefineExpectations and migrate appropriate callersAaron Schulz2018-12-101-2/+2
| | | | | | | Some of the callers of setExpectations() actually need to reset the old expectations to avoid erroneous warnings. Change-Id: I63c01c0f6cd748bdc849f1a5264e17bd377b9d11
* build: Updating mediawiki/mediawiki-codesniffer to 23.0.0Umherirrender2018-12-011-3/+4
| | | | | | Avoid use of __METHOD__ magic constant in closure Change-Id: I28d519530ca2fcde026a6cbb419848098d4617ca
* Avoid post-send DBPerformance log warnings for page rollbackAaron Schulz2018-11-221-0/+3
| | | | Change-Id: I3d4eafc7d9d04647955822d5100d8cf253d80c8a
* RollbackAction/SpecialUndelete: Use OutputPage::addWikiMsg() where possibleC. Scott Ananian2018-10-261-2/+6
| | | | | | Gently discourage the unnecessary use of OutputPage::addHTML(). Change-Id: Ibb33c056dee2344e9a7a5955408eb56c753acb7b
* Silence transaction profiler master queries notices for rollbackAaron Schulz2018-10-241-0/+5
| | | | Change-Id: I53f0149cbf69ee2e57fe556668dd6cbfadd79823
* build: Updating mediawiki/mediawiki-codesniffer to 22.0.0Umherirrender2018-09-161-1/+0
| | | | | | | | | Added spaces around . Removed empty return statement which are not required Removed return after phpunit markTestIncomplete, which is throwing to exit the test, no need for a return Change-Id: I2c80b965ee52ba09949e70ea9e7adfc58a1d89ce
* Add GENDER to rollback-success messagePurodha2017-02-221-2/+8
| | | | | Bug: T141250 Change-Id: I99c2b5ad5594b25928ad5bfd3f3a36b19a2c041c
* RollbackAction: Allow 'from' to be an empty stringTimo Tijhof2016-09-071-1/+1
| | | | | | | | | | | | | | | | | | | Fix regression from 9af38c046c86, which made 'from' a required non-empty parameter where previously an empty value was allowed. The rollback links always include a 'from' parameter, but it is set to an empty string by Revision::getUserText if the current revision has its username hidden. Test plan: * Go to action=history, tick latest revision and "Change visibility". * Tick "Editor's username" and apply the change. * Hit "rollback" on the history page. * Before: "missing parameter" error. After: Success. Bug: T141985 Change-Id: I20d23e2aeec858f82231910c030c14ffa3af656f
* Rollback: Catch error when unable to load latest revision dataChad Horohoe2016-08-261-0/+3
| | | | | | | Ideally this never happens, but it can, so fail gracefully instead of just throwing a 'call to a member function on non-object' message Change-Id: Iac8be9c7994aa3e74ed3c0eecff211524037165e
* RollbackAction: Don't return true, causes '1' to be outputKunal Mehta2016-05-271-2/+2
| | | | | Bug: T136375 Change-Id: Id994b7ee7044ce18cf245a219ba290970511ea0f
* Revert "RollbackAction: Implement AJAX interface and require POST"Krinkle2016-05-271-35/+12
| | | | | | | | | | | | | | | | | This partially reverts commit 9af38c046c. * The new JS modules continue to exist. While not used by default, the mediawiki.api.rollback may be used elsewhere by now. The mediawiki.page.rollback module may still be used on cached pages and should continue to work. * The new API behaviour remains. * To avoid breaking mid-air rollbacks again, the token remains the same (plain "rollback" salt). We're not re-introducing the web-specific salt again. Bug: T136375 Change-Id: Iba17ce55ff9506e838bfc6e70ca280e5a20b77b6
* RollbackAction: Implement AJAX interface and require POSTTimo Tijhof2016-05-231-23/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to WatchAction (converted in commit 77cdf1919). * Make FormAction::getFormFields not abstract. In most cases this will just be an empty array. * Convert RollbackAction from FormlessAction to FormAction and implement the required error handling scenarios (mostly moved out of from the old method, or duplicated from the WikiPage method where necessary). * In most cases the in-between form is never used since a JavaScript handler takes over the link and uses the API over AJAX instead. In the no-js fallback (as well as for any existing tokenless rollback links) copy the GET parameters into the form for re-submission as POST (plus token, added by HTMLForm). * Remove the distinction between WebUI and API tokens. This stronger token salt made it unnecessarily complex and was only there because it used GET until now. This streamlining of tokens matches what we already do for 'watch', 'edit', 'patrol' and other actions. * Fix form submission bugs when 'from' query parameter is missing. - Ensure the required 'from' query parameter is present before showing a form. No need for the user to submit a form we know will fail. - Plain GET request to action=rollback (with no parameters) is now a 400 Bad Request instead of a form that would fail when submitted. - Submitting the form without 'form' field now correctly says why it failed. Previously it emitted a session error, which was a lie. Bug: T88044 Change-Id: Ia457802fec2e90573c8e7d552bc1f3cee258f10b
* Move WatchedItem logic to WatchedItemStoreaddshore2016-03-081-1/+1
| | | | | | | | | | | | | | | | | This also removes assumptions that when a page in one Namespace should be watched / removed that the page in the talk / subject ns for the page should have the same action applied This should maintain all backward compatability for the WatchedItem class This also includes tests written by: - WMDE-leszek - Addshore Bug: T127956 Change-Id: Iad9abafe4417bb479151a3bfbee6e1c78a3afe3c
* Convert all array() syntax to []Kunal Mehta2016-02-171-2/+2
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Distinguish read vs write mode Action classesAaron Schulz2016-01-151-0/+4
| | | | | Bug: T123589 Change-Id: I3c8fab646d3bb8cd468e5b60c27f3c5d43f9f97c
* Fix issues identified by SpaceBeforeSingleLineComment sniffVivek Ghaisas2015-09-261-2/+2
| | | | Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
* RollbackAction: Remove dead argumentjeroendedauw2015-09-241-1/+1
| | | | Change-Id: Icd1584460e68422e50d4391bfbdf0d938ab1c1cf
* Added wfTransactionalTimeLimit() method and applied itAaron Schulz2015-08-121-0/+3
| | | | | | | | | | | | * Potentially long running POST requests often use multiple transactions, talk to multiple services, or defer updates. Try to make sure they have a chance to complete all of the work. WMF already sets ignore_user_abort() across the board in config, but this applies it to key spots for all installs, in addition to bumping the time limit. * Eventually this can lower the need for high overall time limits. Bug: T102890 Change-Id: I893ddd773064dcd63b5b24c84c6391974f4b5aee
* Create preference to watchlist pages after rollbackingÉtienne Beaulé2014-07-301-0/+6
| | | | | | | | | | | This change adds a preference in the 'watchlist' section to automatically watchlist a page after rollbacking. The setting is only visible, if the user has the 'rollback'-right. I have removed the watch reverts function per advice by Vogone. Bug: 4488 Change-Id: I3aa831c9c04d627684641af0ca5a332795c87062
* Random documentation tweaksSiebrand Mazeland2014-01-021-0/+2
| | | | Change-Id: I57c3bde6551c14324cf34e4db003a319d6cebc47
* Break long lines in Action classesSiebrand Mazeland2013-11-141-4/+15
| | | | | | Fixes CodeSniffer errors and warnigs. Change-Id: Ic9cf4b9c677b3168d7c9820e2694080907997ee3
* merge latest master into Wikidata branchdaniel2012-10-081-9/+2
|\ | | | | | | Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
| * Simplify code for usertools in RollbackActionumherirrender2012-10-071-9/+2
| | | | | | | | Change-Id: Ib550084ca60f54a0c1b1a3d6479fba75bc4f22bf
* | Merge "Fix error display on failing rollback" into Wikidatadaniel2012-08-291-14/+7
|\ \
| * | Fix error display on failing rollbackdaniel2012-08-271-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rollback will now show the actual errors that caused it to fail, instead of a misleading message about permissions. Also, errores returned by WikiPage::doEditContent are now propagated and shown. Change-Id: I5a3f8cb7a0b881d07d52f63504dd3757192205a9
* | | Fixing creation of DifferenceEningedaniel2012-08-241-1/+1
|/ / | | | | | | | | | | | | Creation of DifferenceEninge insteances was based on invalid assumptions in several places. Change-Id: Ib67ca893ea53a27d4ac7efd8a9ca0d3b2d93949f
* | Fix indenting errors introduced in Wikidata branchTim Starling2012-06-191-2/+2
| | | | | | | | Change-Id: I487a0966a26359d4a6769331a6e2ee356eeb41db
* | renamed getDifferenceEngine to createDifferenceEnginedaniel2012-04-171-1/+1
| |
* | Merge branch 'master' into WikidataJens Ohlig2012-04-111-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .gitreview includes/Article.php includes/AutoLoader.php includes/EditPage.php includes/LinksUpdate.php includes/WikiPage.php includes/installer/Ibm_db2Updater.php includes/installer/MysqlUpdater.php includes/installer/OracleUpdater.php includes/installer/SqliteUpdater.php maintenance/refreshLinks.php
| * Use local context to get messagesAlexandre Emsenhuber2012-03-281-3/+3
| | | | | | | | Change-Id: Ic173f92f56f74261a34c896fbd1f45ec097129d6
| * fix doc grouping for actionsAntoine Musso2012-02-081-2/+2
| | | | | | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110942
* | use factory method to get difference engine everywhereDaniel Kinzler2012-04-041-1/+2
|/
* Made DifferenceEngine use a context instead of global variables and updaters ↵Alexandre Emsenhuber2011-11-101-1/+1
| | | | | | | calls to constructor in core Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/102649
* * Made PermissionsError exception accept an optional second parameter for ↵Alexandre Emsenhuber2011-11-021-3/+1
| | | | | | | | | | | | | | | the description of the errors (as returned by Title::getUserPermissionsErrors()) * PermissionsError now calls OutputPage::showPermissionsErrorPage() to display the error (this is needed to make the item above work correctly) * Removed the override of the HTML title in OutputPage::showPermissionsErrorPage() so that it shows "Permission errors - Sitename" instead of simply "Permission errors" for consistency with the other things * Pass the error array returned by Title::getUserPermissionsErrors() to PermissionsError where available * Converted direct calls to OutputPage::showPermissionsErrorPage() to throw an PermissionsError error instead * Added 'action-rollback' message that will be displayed when accessing action=rollback without sufficient rights * Changed getRestriction() in subclasses of Action to return null when they previously returned 'read' so that user rights can be check with Title::getUserPermissionsErrors() * Reordered checks to do first user rights, then block (if needed) and finally read only (also if needed) so that users don't think the error is temporary when they both don't have right and the database is locked Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101630
* Per Nikerabbit's comment on r100621:Alexandre Emsenhuber2011-10-271-2/+2
| | | | | | | | | | * Removed OutputPage::setPageTitleMsg() and OutputPage::setHTMLTitleMsg() and make OutputPage::setPageTitle() and OutputPage::setHTMLTitle() accept a Message object * Updated core calls (including some that I missed last time because of non-matching case) * Added Message::setContext() and use it in RequestContext so that I don't need to duplicate the call in OutputPage * Yes, I'm calling $this->msg() on places and then setting the context one more time in OutputPage::setPageTitle() or OutputPage::setHTMLTitle(), but at least I won't be confused about which objects $ Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101037
* Added OutputPage::setPageTitleMsg() and OutputPage::setHTMLTitleMsg() as ↵Alexandre Emsenhuber2011-10-241-2/+2
| | | | | | | modified versions of OutputPage::setPageTitle() and OutputPage::setHTMLTitle() that take an message name and its parameters; updated all calls in core that can use the two new functions Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100621
* * Use wfMessage() instead of OutputPage::addWikiMsgArray() with the third ↵Alexandre Emsenhuber2011-07-161-2/+2
| | | | | | | | | parameter * In EditPage.php: call Linker methods statically Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92376
* Moved action=rollback to an Action subclassAlexandre Emsenhuber2011-07-021-0/+122
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91353