aboutsummaryrefslogtreecommitdiffstats
path: root/includes/actions/FormAction.php
Commit message (Collapse)AuthorAgeFilesLines
* Replace deprecated HTMLForm::addPreText/addPostTextUmherirrender2024-07-141-3/+3
| | | | | Bug: T325474 Change-Id: Iea85b2935ecec3aa0c02323188f5e2f1ff5fd3e4
* Use namespaced classes (3)Umherirrender2024-06-161-0/+1
| | | | | | | Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: Ia35b2d3105880631dd26ec974068b000ac7f4b6b
* Reorg: Move Status to MediaWiki\Status\Amir Sarabadani2023-08-251-0/+2
| | | | | | | | | | This class is used heavily basically everywhere, moving it to Utils wouldn't make much sense. Also with this change, we can move StatusValue to MediaWiki\Status as well. Bug: T321882 Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3 Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
* FormAction: Correct return type documentation of getFormEd Sanders2021-04-271-1/+1
| | | | | | | Always returns $form, which is either a new HTMLForm directly, or the result of HTMLForm::factory, which is also an HTMLForm. Change-Id: I2a87639e1e1ca8ff1e3c023077593059697afa45
* Merge "Replace "@stable for subclassing" with "@stable to extend""jenkins-bot2020-07-131-1/+1
|\
| * Replace "@stable for subclassing" with "@stable to extend"daniel2020-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | For compliance with the new version of the table interface policy (T255803). This patch was created by an automated search & replace operation on the includes/ directory. Bug: T257789 Change-Id: Ie32c1b11b3d16ddfc0c83a757327d449ff80b2e4
* | Replace "@stable for overriding" with "@stable to override"daniel2020-07-131-8/+8
|/ | | | | | | | | | | For compliance with the new version of the table interface policy (T255803). This patch was created by an automated search & replace operation on the includes/ directory. Bug: T257789 Change-Id: I5ffbb91882ecce2019ab644839eab5e8fb8a1c5f
* Mark action base classes as extensibledaniel2020-07-081-0/+13
| | | | | Bug: T247862 Change-Id: I8feae306c127b33c7f79ef81c5039f1442f35ab6
* Hooks::run() call site migrationTim Starling2020-05-301-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate all callers of Hooks::run() to use the new HookContainer/HookRunner system. General principles: * Use DI if it is already used. We're not changing the way state is managed in this patch. * HookContainer is always injected, not HookRunner. HookContainer is a service, it's a more generic interface, it is the only thing that provides isRegistered() which is needed in some cases, and a HookRunner can be efficiently constructed from it (confirmed by benchmark). Because HookContainer is needed for object construction, it is also needed by all factories. * "Ask your friendly local base class". Big hierarchies like SpecialPage and ApiBase have getHookContainer() and getHookRunner() methods in the base class, and classes that extend that base class are not expected to know or care where the base class gets its HookContainer from. * ProtectedHookAccessorTrait provides protected getHookContainer() and getHookRunner() methods, getting them from the global service container. The point of this is to ease migration to DI by ensuring that call sites ask their local friendly base class rather than getting a HookRunner from the service container directly. * Private $this->hookRunner. In some smaller classes where accessor methods did not seem warranted, there is a private HookRunner property which is accessed directly. Very rarely (two cases), there is a protected property, for consistency with code that conventionally assumes protected=private, but in cases where the class might actually be overridden, a protected accessor is preferred over a protected property. * The last resort: Hooks::runner(). Mostly for static, file-scope and global code. In a few cases it was used for objects with broken construction schemes, out of horror or laziness. Constructors with new required arguments: * AuthManager * BadFileLookup * BlockManager * ClassicInterwikiLookup * ContentHandlerFactory * ContentSecurityPolicy * DefaultOptionsManager * DerivedPageDataUpdater * FullSearchResultWidget * HtmlCacheUpdater * LanguageFactory * LanguageNameUtils * LinkRenderer * LinkRendererFactory * LocalisationCache * MagicWordFactory * MessageCache * NamespaceInfo * PageEditStash * PageHandlerFactory * PageUpdater * ParserFactory * PermissionManager * RevisionStore * RevisionStoreFactory * SearchEngineConfig * SearchEngineFactory * SearchFormWidget * SearchNearMatcher * SessionBackend * SpecialPageFactory * UserNameUtils * UserOptionsManager * WatchedItemQueryService * WatchedItemStore Constructors with new optional arguments: * DefaultPreferencesFactory * Language * LinkHolderArray * MovePage * Parser * ParserCache * PasswordReset * Router setHookContainer() now required after construction: * AuthenticationProvider * ResourceLoaderModule * SearchEngine Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
* Remove direct access to Action::page and Article::page propertiesArtBaltai2020-03-271-2/+13
| | | | | Bug: T239975 Change-Id: Id0d4d1e099edbdd67cabbed423dfff68cc48d323
* WatchAction::onSubmit return correct value, not always trueFlorian Schmidt2018-05-231-1/+6
| | | | | | | | | | | | | | | | | | The onSubmit method documentation states, that the caller can expect either true for a successfull run, false if not tried and an array of error messages in case of an failure. WatchAction however always returned false, even though a Status object is availble with all needed information. The behaviour of WatchAction::onSubmit is now changed to return the appropriate value taken from the returned Status object of WatchAction::doSelf. Also: * Added WatchAction test class to higher test coverage, especially for the static methods * Marked getUnwatchToken as deprecated, it's not used and a caller can easily switch to getWatchToken with "unwatch" as the action parameter Change-Id: I2c1b91e1884a0d5f27f5e7ab9eafd6173642c21c
* Convert various FormActions to OOUIThis, that and the other2017-03-111-1/+13
| | | | | | | | | | | Support for OOUI is added to FormAction, and subclasses can enable it as required. PurgeAction, RevertAction, WatchAction and UnwatchAction are converted to OOUI, with minor changes to the forms to give them a neater appearance. Bug: T160236 Change-Id: I5294e5d886e8641e9b63eabc9d7fa8ea93e0df96
* Convert all array() syntax to []Kunal Mehta2016-02-171-6/+6
| | | | | | | | | | 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
* WatchAction: Clean up redundant getFormFields() and show()Timo Tijhof2015-09-281-5/+11
| | | | | | | | | | | | | * Make FormAction::getFormFields not abstract. In most cases this will just be an empty array. This is in prep for RollbackAction as well. * Remove redundant show() in WatchAction. This used to do custom stuff, but after 77cdf1919 it does exactly the same as the parent FormAction::show. * Don't add 'redirectparams' hidden field if there were no custom query parameters (e.g. plain index.php?title=..&action=..) Change-Id: Ia7f9bb0367c49a23179e9fefa9f529fa8aef8f52
* WatchAction: Require POST for index.php action=watchTimo Tijhof2015-09-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The GET variant was already rarely used because our frontend enchances these links with a click handler that uses AJAX to make a POST request to the API. The index.php url, nor its token, were used for the majority of users. Simplify this by stripping the 'token' query from these urls and requiring a POST request for index.php?action=watch and unwatch. * FormAction: Actually set a proper '<form action>' instead of letting HTMLForm default to a confusing title path (e.g. /wiki/Pagename). Article path should not be used for POST requests. * WatchAction: Group all FormAction-related methods together. * WatchAction: Make token consistent with other actions now that it is POST-only (no "stronger" salt containing the page title). * Remove ununsed mediawiki.page.startup dependency from mediawiki.page.watch.ajax. * WatchAction: If accessed over GET directly (e.g. for users without javascript) display a confirmation form that submits the token. Similar to PurgeAction. Change-Id: I504f457e68a133bcfc418cff13b838080fec1008
* Replace wfRunHooks calls with direct Hooks::run callsAaron Schulz2014-12-101-2/+2
| | | | | | * This avoids the overhead of an extra function call Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
* Documentation: put FormAction and FormlessAction into "Actions" groupwithoutaname2014-08-021-4/+3
| | | | Change-Id: Iac8a203426897446b8c9f3fbaaa9d608c419bce6
* Remove execute() from Action and subclasseswithoutaname2014-07-161-44/+0
| | | | | | | Since show() is always the preferred entry point, this is never used nor implemented properly. Change-Id: I5fde4bbd420a6695b01fb9220542fd3b49060675
* Fixed some @params documentationumherirrender2014-04-141-7/+7
| | | | | | | | Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Change-Id: I64e8cfe478cb0ba438f40b0631d6e9049cdab567
* Fix spacing after @param and friends in commentsumherirrender2014-04-051-1/+1
| | | | | | | Searched for: \@(param|return|throws|since|deprecated|access|todo|var)[ \t]{2,} Change-Id: Icce22ba9fe0635455691ca58d9872d618151f346
* Split the rest of Action.php into /actions/addshore2014-03-031-0/+168
Change-Id: I071ac5778af63a5cffffd59d804c99b2c799d4e5