Commit graph

25 commits

Author SHA1 Message Date
Thiemo Mättig
16c26f8eb8 Add missing …|null $context documentation to Action class
Change-Id: If365123ffafe8c3eb7566432276131f815a68280
2016-07-05 16:49:17 +02:00
jenkins-bot
f829125b49 Merge "Revert "Make an empty "?action=" parameter default to "view""" 2016-05-18 19:06:24 +00:00
Krinkle
caf87b4893 Revert "Make an empty "?action=" parameter default to "view""
This reverts commit b287ec2cc6.

Change-Id: I59e996dfe627e8a978ed849a8e82ad4e0b165d7f
2016-05-18 18:54:50 +00:00
jenkins-bot
92e3d2f1a3 Merge "Add actual documentation for ContentHandler::getActionOverrides" 2016-05-18 17:41:05 +00:00
Thiemo Mättig
c415767e0e Add actual documentation for ContentHandler::getActionOverrides
Change-Id: I7fd803204ad137dd3510ea321ff7e6fa11d910c0
2016-05-18 15:49:26 +02:00
Thiemo Mättig
b287ec2cc6 Make an empty "?action=" parameter default to "view"
When no action is given, e.g. in
https://en.wikipedia.org/wiki/URL
the action defaults to "view". Just like you called
https://en.wikipedia.org/wiki/URL?action=view

But when the action is empty, e.g.
https://en.wikipedia.org/wiki/URL?action=
you get an error message telling you that "the action specified"
can not be "recognized". Wait, I did not "specified" an action.
That's why I left the parameter empty. From the users point of
view I expect the empty string to behave like null/undefined.

This is a resubmit of I331924d without the problematic bits.

Change-Id: I07847600bb24ae078276acf98e6eb244039414d7
2016-05-17 18:36:39 +02:00
Roan Kattouw
9680bf8c82 Action:🏭 Don't crash on missing Action classes
Show the "no such action" error message instead.

Normally I wouldn't favor putting this in here, but it's way
too easy to register a missing class by accident, see my rant
on T107921#2128080.

Bug: T107921
Change-Id: I56da8a5810cae3547a0c8f2d3f435dfd790fbeaf
2016-03-16 17:39:54 -07:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
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
2016-02-17 01:33:00 -08:00
Aaron Schulz
543b063773 Distinguish read vs write mode Action classes
Bug: T123589
Change-Id: I3c8fab646d3bb8cd468e5b60c27f3c5d43f9f97c
2016-01-15 01:13:38 +00:00
Timo Tijhof
77cdf1919a WatchAction: Require POST for index.php action=watch
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
2015-09-28 15:21:12 -07:00
Aaron Schulz
9bba2d169e Added wfTransactionalTimeLimit() method and applied it
* 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
2015-08-12 22:09:40 +00:00
Federico Leva
b66622f343 Use getActionName() static
Change-Id: I3225ecd2b8e4294c28ea0aa664f0246d0d028b11
2015-05-18 20:27:48 +00:00
Nemo bis
1e81e7f8a0 Declare global in Action
Follows up e928d5bdd0.

Change-Id: I06e8490865554a0efa7678be6787deb8a22c5b82
2015-05-16 19:51:32 +00:00
Federico Leva
e928d5bdd0 Allow to customise addHelpLink() target via system message
Method similar to SpecialPage::outputHeader() to avoid registering
tons of system messages and to have -summary and -helppage tidily
listed together in Special:AllMessages by default.

Bug: T45591
Change-Id: Ic849dde00be7379c1909a8486cf20f48c5aea5cf
2015-05-15 10:14:28 +02:00
This, that and the other
5c4681012e UI for adding and removing change tags on revisions and log entries
There is a new special page, Special:EditTags, which is very similar to
Special:RevisionDelete in a lot of ways. In fact, the SpecialEditTags class
started off as a copy-paste of SpecialRevisiondelete.

You invoke this special page by going to an article history page, checking
some revisions, and clicking "Edit tags of selected revisions". Then you
pick the modifications you want to make and click "Apply". Very much like
the revision deletion workflow.

I had to restructure some of the Action routing code, which was only
designed to handle revision deletion. Also removing some code from
SpecialRevisiondelete which didn't work as advertised in the first place,
and definitely doesn't work now.

Change-Id: I7d3ef927b5686f6211bc5817776286ead19d916b
2015-04-15 18:31:12 +00:00
Brion VIBBER
4587cd5c71 Revert "Make an empty "?action=" parameter default to "view""
Breaks all non-view actions on dev wikis, something's not right with the patch.

This reverts commit a90b7ea969.

Change-Id: Ib9a5eb07ef48716df193fbb62a86c13e5c80dafd
2014-10-11 17:15:49 +00:00
Thiemo Mättig
a90b7ea969 Make an empty "?action=" parameter default to "view"
When no action is given, e.g. in
https://en.wikipedia.org/wiki/URL
the action defaults to "view". Just like you called
https://en.wikipedia.org/wiki/URL?action=view

But when the action is empty, e.g.
https://en.wikipedia.org/wiki/URL?action=
you get an error message telling you that "the action specified"
can not be "recognized". Wait. I did not "specified" an action.
That's why I left the parameter empty. It doesn't make much sense
to have an empty action name that's different from the "view"
default, right? From the users point of view I expect the empty
string to behave like null/undefined.

Change-Id: I331924d9223e597293bc8285f0c330edf08e429b
2014-10-10 21:52:07 +02:00
umherirrender
cb33db78be Use local var in Action::setHeaders
Change-Id: I543d45835016fd6f4f2ec0e84f4e5453237bbf25
2014-09-13 07:21:32 +00:00
addshore
0a6b7e0f56 Add @since tags for initial Action.php methods
These were introduced in r86001
Hash: 8779f4b55f

Change-Id: I1ae1d4f220d20961f77d2c913fd4f17233893c45
2014-08-29 14:53:54 +01:00
umherirrender
226760304e Remove return from Action::checkCanExecute
No need to return true on success, because failure gives Exception,
so the return value needs no checking.

Change-Id: Id59bfaebc14bd1c638a721c303f585c1de627508
2014-08-12 18:17:27 +02:00
withoutaname
a4aaac4f80 Remove execute() from Action and subclasses
Since show() is always the preferred entry point, this is never used
nor implemented properly.

Change-Id: I5fde4bbd420a6695b01fb9220542fd3b49060675
2014-07-16 14:03:43 -07:00
withoutaname
e45e0b1a66 Removed getLang() from IContextSource and subclasses
Change-Id: I94c3df814c06c54c071f371101882dcc71c99417
2014-06-20 11:36:59 -07:00
umherirrender
829886b10a Fixed some @params documentation
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
2014-04-14 12:59:19 +00:00
Alexandre Emsenhuber
449ee32451 Add missing line breaks to wfDebug() calls
Also removed true as second parameter to it from CloneDatabase.php
since it is the default value of that parameter.

Change-Id: I727ebae2bd4df0e26019985ce8c7ce73381c5642
2014-03-29 11:52:07 +01:00
addshore
58884580eb Split the rest of Action.php into /actions/
Change-Id: I071ac5778af63a5cffffd59d804c99b2c799d4e5
2014-03-03 12:31:57 +00:00
Renamed from includes/Action.php (Browse further)