Commit graph

166 commits

Author SHA1 Message Date
Kunal Mehta
cefab8bcbe page: Avoid deprecated wfMemcKey()
And the deprecated ObjectCache::getMainWANInstance(),
getMainStashInstance() while we're at it.

Change-Id: I951c356f1c394a9658216dea54c92824dca83cbc
2017-05-25 11:20:23 -07:00
Fomafix
0927a5045d Clear postEdit cookie on server-side
* Load module 'mediawiki.action.view.postEdit' only when needed.
* Transfer message key via JavaScript config variable wgPostEdit.
* The response is maked as not-cachable to prevent that other users get the
  post edit message.

This change redefines the global JavaScript variable wgPostEdit from true
to a string and set it on server-side.

Bug: T164148
Change-Id: Id780bc280ce4a2fa4606141419932b7dcd45157b
2017-05-05 23:58:19 +00:00
Fomafix
7a3418ae33 Use consistent spaces at start and end of comments
Change-Id: Idbb09b69aa1ef4e46433319aaea62f34f0dbc038
2017-03-30 22:06:40 +02:00
Brad Jorsch
f4a306fb18 Deprecate "Avoid page_touched update for HTTP GET action=purge requests"
This reverts most of commit c84ba4d864.
The changes made there are no longer needed, and nothing in Gerrit seems
to have started using them since they were added.

The added constants in WikiPage, WikiPage::getLastPurgeTimestamp(), and
Article::getLastPurgeTimestamp() are deprecated, useless, and unused,
but not removed yet since they snuck into 1.28 so we can't revert them
without a deprecation period. Sigh.

Bug: T145649
Change-Id: I526fd4e004bee84c831a4cee71e44e92ee73480b
2017-03-27 10:10:26 -04:00
WMDE-Fisch
7b5f08e703 Replace deprecated Context::getStats() with MWServices::getStatsdDataFactory()
Change-Id: I1756f69ca2ebd301a5049bf758d1a87c37771fe6
2017-03-17 12:07:03 +01:00
jenkins-bot
17eda64357 Merge "includes: Replace implicit Bugzilla bug numbers with Phab ones" 2017-02-28 00:51:57 +00:00
Umherirrender
4d16c2ad56 Use Database::addQuotes instead of hard coded apostrophs
Change-Id: I1404d68d7e2b7fde8f9a76c747bc2be0936f7bef
2017-02-22 18:55:56 +01:00
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
Florianschmidtwelzow
4b49705613 Revert "Added reason suggestion in block/delete/protect forms"
See the task, this was probably entirely my fault not having
looked at this more carefully. Technically the change is ok,
however, it seems to doesn't make much sense in combination
with the Reason dropdown box.

This reverts commit faab2411c2.

Task: T34950
Change-Id: I1eeb9c68ff0db20d29e7d5f0fb18f0bfa3224416
2017-01-21 20:03:45 +01:00
Reedy
d0f46171ca Add deprecated annotation to Article::doEditContent()
Change-Id: I5a15b22c8b12fe77105fbd31427e8a15cde327c6
2017-01-19 03:54:08 +00:00
Reedy
ca8e1ed0aa Mark Article::doEditContent() as deprecated
Bug: T155696
Change-Id: Ie91b428f3a5992ba85c6ca2b2909953d8fce139b
2017-01-19 03:34:26 +00:00
Subin Siby
5eff86b740 Remove deprecated function Article::doEdit() and WikiPage::doEdit()
Bug: T61113
Bug: T154498
Change-Id: Ie6c1bb4ee5ee45ac2db432877a7038659231c091
2017-01-19 02:44:01 +00:00
Reedy
61f9600b93 Article::getContent() was removed
Bug: T154498
Change-Id: I27956d494cf19d1204988807130b43f77186db9b
2017-01-19 01:49:07 +00:00
Reedy
6da9fc55c5 Un-deprecate ArticleAfterFetchContentObject hook
Accidentally done in I58a0c46b95b8ef02ff55851cfdec7e9d6eeed83c

Bug: T154672
Change-Id: I900232ea01a434b40091fca4627739310d7b3f1d
2017-01-15 07:07:34 +00:00
rlot
8c7095be85 Improved parsing in reason suggests
Bug: T155086
Change-Id: I3a3167b7bfd9b5921df1cf3e4a3cf3e1da4ca001
2017-01-11 19:00:00 +01:00
rlot
faab2411c2 Added reason suggestion in block/delete/protect forms
Bug: T34950
Change-Id: I9778c4992b127c36355949665b4fdf7482e7e0e7
2017-01-10 21:18:51 +00:00
divadsn
a18a0af425 Replace &$this with $this in MediaWiki/core hook system
Bug: T153505
Change-Id: Ie287adf8b1d384aa651c659a9d385877379a0f11
2016-12-26 14:26:21 +00:00
Reedy
f7ae4d41b8 Article::fetchContent() was removed
Bug: T145728
Change-Id: Ie8bc12e391f2983452bf472333ea3cfaa72e4918
2016-12-12 19:21:02 +00:00
Thiemo Mättig
00c3f09566 Remove empty lines from PHP and JavaScript comment blocks
This is a pure documentation change. It mostly removes empty lines from
comments (and entirely empty comments), as well as adds a few missing
documentation blocks and fixes a minor mistake. I hope it's ok to have
this in one patch. I can split it, please tell me.

Change-Id: I9668338602ac77b903ab6b02ff56bd52743c37c4
2016-12-09 09:01:06 +00:00
Reedy
2c74b04356 ArticleViewCustom, EditPageGetDiffText and ShowRawCssJs were removed
Bug: T145728
Change-Id: Iddf29005abbaceaa1e3cc2c79e4becfb46294414
2016-12-03 12:27:07 +00:00
Reedy
ec6d6762ea Article::getAutosummary() and WikiPage::getAutosummary() were removed
Bug: T145728
Change-Id: I233571658b902c93a148a992ea99eb159551e732
2016-12-03 12:16:41 +00:00
Reedy
0c7d0d38db Remove ContentHandler functions with no usages at all
Bug: T145728
Change-Id: Ia0d7a5eb7e79b586c3b30688c80bb8b4b723fff6
2016-12-03 12:13:25 +00:00
Timo Tijhof
4ff510e4a7 Convert action=markpatrolled fallback interface to HTTP POST
The main interface already has javascript enhancement to use
the API and mw.notify. This patch affects permalinks without
tokens, and opening the link without javascript.

This will match the current behaviour of action=watch.

Bug: T130946
Change-Id: I6be2c07824c17b165e068fc4ac36ab192e12bc9d
2016-11-04 23:57:26 +00:00
jenkins-bot
a6c5f1a815 Merge "Use adaptive CDN TTLs for page views" 2016-10-21 21:55:52 +00:00
Aaron Schulz
4a3e3c95b3 Use adaptive CDN TTLs for page views
This makes frequently changed pages be less likely to be
seen in stale forms if purges are delayed or lost. Pages
that have not been edited for somewhat longer than the
nominal CDN cache TTL will retain the nominal TTL.

Category pages will adapt based on page_touched rather
than the last revision, given the possibility of constaintly
changing membership. With their lesser overall usage,
this is less risky than for Article, and also more useful.

Change-Id: If621aca2fb68e9f87a50c891dac8dc6ec7641f5c
2016-10-20 23:22:31 +00:00
Reedy
303e9b4622 Make Article::getContent() emit deprecation warnings
Bug: T145729
Change-Id: I35b619cfc0c1548deb8805b4aacd3477dec0d1f7
2016-10-08 13:28:38 +01:00
Reedy
97d9916a3d Make more ContentHandler replaced hooks emit deprecation warnings
ArticleAfterFetchContent, ArticleSave

Bug: T145728
Bug: T147387
Bug: T147389
Change-Id: I58a0c46b95b8ef02ff55851cfdec7e9d6eeed83c
2016-10-06 22:50:26 +00:00
Reedy
8a29a56fb1 Make ShowRawCssJs hook emit deprecated warnings
Bug: T147392
Change-Id: Iae3b1532a91a9bf545a0a3c8df1df5e59b4974db
2016-10-06 14:44:57 +01:00
Reedy
e9bc1588fb Add @deprecated to Article::prepareTextForEdit()
Bug: T146166
Change-Id: Id7d56b49ebe058e022774d75aff2d11784d32fa5
2016-10-06 14:22:42 +01:00
Reedy
dee0d1ce4e Mark 3 hooks deprecated by ContentHandler as such
ArticleViewCustom, EditPageGetDiffText and EditPageGetPreviewText hooks
now marked as deprecated in 1.21.

TitleIsCssOrJsPage and TitleIsWikitextPage deprecation version dropped
from 1.25 to 1.21 to match other hooks.

Bug: T145728
Bug: T147382
Bug: T147383
Bug: T147384
Bug: T147385
Bug: T147386
Change-Id: I59b6b9f253857eb1040dad879a71e0d8cf141553
2016-10-05 23:41:14 +00:00
Timo Tijhof
6aa6519293 page: Remove unused WikiPage::doQuickEditContent()
This is a rather hakcy method that bypasses various cache invalidation
updates. This method shouldn't be (and, fortunately, isn't) called
anywhere in Wikimedia Git.

Change-Id: I03ede077294344c420827e4a6527d4c5fc3509b0
2016-10-04 21:14:33 +00:00
enigmaeth
a285a8e2c0 Emit deprecation warnings for Article::doEdit and WikiPage::doEdit
Bug: T145736
Change-Id: I637daea7412d8acb8561f9a821af1882e49ddd9b
2016-09-27 20:40:58 +00:00
jenkins-bot
703fe3378f Merge "Move tagging of API deletions to RC save" 2016-09-23 07:46:04 +00:00
Reedy
8d2157c9c2 Add deprecated comment to Article::doEdit()
Already there on WikiPage, but this brings it to the IDEs
attention rather than @see

Bug: T145736
Change-Id: Ic931f83d15638f2babce22edf14ee8626b8a0266
2016-09-21 21:13:20 +01:00
cenarium
e1509f0caa Move tagging of API deletions to RC save
Since the recent change save of logged actions is now deferred, we need
to move tagging of API deletions to the RC save, like other API actions
do already. Otherwise, only the log gets tagged, not the RC.

Bug: T108564
Change-Id: I4e6e18e7f8fb7a6b0932e7579bafddcc1b0a9758
2016-09-21 19:18:28 +02:00
jenkins-bot
1827c891f5 Merge "Emit deprecation warnings from Article::fetchContent" 2016-09-20 22:08:04 +00:00
daniel
b1fae29798 Emit deprecation warnings from Article::fetchContent
Bug: T145734
Change-Id: Ia70dedc729fc4724b773a29d8789ace344ae0df9
2016-09-20 18:57:49 +02:00
Aaron Schulz
108ccb0352 Make rebuildFileCache cover ?action=history
Also simplified the logic slightly

Change-Id: I6145d52b6b701735fa4bd8e41e07fb2bf6fdcee3
2016-09-20 00:53:26 -07:00
Kunal Mehta
20b6d1cda7 Emit deprecation warnigns for Article::getText()
Deprecated since 1.21.

Bug: T145747
Change-Id: I6fe620702fcc455dbe229abca1145b0c8ea3f8d2
2016-09-15 01:45:43 -07:00
jenkins-bot
3e35565c93 Merge "Avoid page_touched update for HTTP GET action=purge requests" 2016-09-13 06:40:52 +00:00
Aaron Schulz
c84ba4d864 Avoid page_touched update for HTTP GET action=purge requests
This will still clear the local DC parser cache and the CDN cache
in all DCs. Therefore, the next page views served by the local
DC will reflect the refreshed content, as will further GET/HEAD
requests by the client that issued the purge using GET/HEAD.

If the problem was imply a stale CDN cache entry, then all
DCs will be up-to-date. If the problem is stale parser cache,
then a proper POST purge request is required to refresh all DCs.

Bug: T92357
Change-Id: I9af12ca8cfff73298f404fd3e2dd4f546621c546
2016-09-13 05:24:46 +00:00
Kunal Mehta
e65f93f827 Use late static binding in Article::newFromID()
Address the FIXME and remove subclass implementations by using late
static binding.

Change-Id: I4f1793c87dfe08f768a283128d14ee2226a9e275
2016-09-12 21:46:12 -07:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Aaron Schulz
16266edff3 Change "slave" => "replica DB" in /includes
Change-Id: Icb716219c9335ff8fa447b1733d04b71d9712bf9
2016-09-05 21:01:01 +00:00
Aaron Schulz
20400cb21f Move HTTP 304 check from performRequest to ViewAction
* Follow-up to 8b141886ed
* The method is now called after the setCdnMaxage() call
  in performAction.
* Allow any CDN urls for the title now, check $wgDebugToolbar,
  and allows caching redirects. The multi-step redirect case does
  not cache however, for simplicity.
* Removed now-unused code in Article that calculated $timestamp.

Change-Id: Ic4f4e3a79d7d386c2f15ca5b11dddf5c57ff9e9f
2016-08-29 14:23:16 -07:00
Aaron Schulz
8b141886ed Move Article checkLastModified() up to MediaWiki::performRequest
This lets revalidations via IMS headers run a bit faster.

Change-Id: I1f61086dea4c6bc460f6249ed7fda78316117a8d
2016-08-23 23:53:31 -07:00
Bartosz Dziewoński
7cea81b8ff Revert "Move CSS for patrol from mediawiki.legacy to new module mediawiki.page.patrol"
This reverts commit e9f896d6a5.

Bug: T142750
Change-Id: Idb815d64d795d790ea2c07f2b5188ea5a46bfefb
2016-08-11 22:54:54 +00:00
Fomafix
e9f896d6a5 Move CSS for patrol from mediawiki.legacy to new module mediawiki.page.patrol
Also change the selector from
	div.patrollink
to
	.patrollink

Bug: T89981
Change-Id: Ib79d17fab61b1a7b940b2acff6d19a58a3fe0bc9
2016-08-06 13:46:47 +00:00
Baha
02d71fa2cf Wrap revision info and nav in a div for easy formatting in MobileFrontend
Revision info and nav used to be combined with breadcrumbs which made
styling the revision info and nav complicated. The patch wraps these
two divs into an outer div so that MF can style them together easily.

Also make sure rev info and nav appear on different lines as the
`br` tag between them has been removed because of wrapping.

Bug: T139930
Change-Id: Ic7ecf3be7eac6500c20cfc3b3b1fa49d4b4e0d19
2016-08-03 01:03:54 -04:00
Timo Tijhof
46df493ac0 Remove incomplete and dated 'wgUseETag' experiment
Follows-up:
* 8ff36ebd (r9793) Set ETag header on article views.
* 8167b89e (r16205) Add $wgUseETag, false by default (broke Squid; T9098).

ETag is a useful alternative for If-Modified-Since (see T33639, T49529 about
use cases and bugs it may fix). However the current incomplete implementation
isn't useful.

It's a feature flag that has been disabled since 2006. Enabling it stores
ParserCache::getETag in OutputPage and sends it out as a response header.
It's ignored on incoming requests. We don't check If-None-Match for
'304 Not Modified' anywhere.

ResourceLoader has a working implementation that could be leveraged.

To be re-evaluated in the future. ParserCache::getETag() could use
improvement as well.

Change-Id: I37fd9d0ce1ce9bffb79243c6ae340403fdfd769f
2016-06-27 12:43:54 +00:00