Commit graph

23 commits

Author SHA1 Message Date
Brad Jorsch
6ec1a31502 Handle comment truncation in CommentStore
Since the caller doesn't (and shouldn't) know whether CommentStore is
using the old or the new schema, it should leave truncation of comments
to CommentStore.

Change-Id: I92954c922514271d774518d6a6c28a01f33c88c2
2017-09-01 15:03:45 -04:00
Umherirrender
be42e09aa8 build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168

Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||

Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
2017-06-26 17:14:31 +00:00
daniel
b5d5c12552 Fix call to makeContent in SpecialChangeContentModel
ContentHandler::makeContent expects serialized content as the first
parameter, not native data.

Change-Id: Ibf1825a191d10b4dd8b9a5cee95b02b2b91f3d92
2017-06-15 17:56:10 +02:00
rlot
cbe891039f Added log extract to Special:ChangeContentModel
Bug: T154874
Change-Id: I571ea324f31935c2394dce77e31c74c3afb76358
2017-01-09 07:32:20 +01:00
jenkins-bot
3d653e8ab5 Merge "Ensure users are able to edit the page after changing the content model" 2016-09-23 06:16:11 +00:00
Kunal Mehta
2108c55ec5 Ensure users are able to edit the page after changing the content model
It is possible for page restrictions to be dependent upon the content
model a page. The best example of this is user JavaScript and CSS
subpages. This adds a Title::setContentModel() function which allows
mocking a Title's content model for the purpose of permission checks.

EditPage and Special:ChangeContentModel were updated to ensure the user
can edit the page with the newly proposed content model before making
the change.

Title::$mContentModel was made private to make sure nothing else mucks
around with it. There were no uses outside of Title anyways.

Bug: T145316
Change-Id: I28c46f408cadf65ed1868401cd00dc15e5acd2fe
2016-09-22 22:22:48 -07:00
Kunal Mehta
7348c411a7 Special:ChangeContentModel: Run EditFilterMergedContent hook
This will allow tools like AbuseFilter to filter changes made through
the special page, and matches the EditPage behavior that already runs
this hook.

Bug: T145489
Change-Id: I3204e3a228af2cdd4e2ab4e8c760cc126a8e1947
2016-09-13 17:06:46 -07:00
Kunal Mehta
664baa2b5e Add rate limits for changing a page's content model
The defaults are set to the same value as page moves.

Change-Id: I72d6c35ecda475101c1c909715e4ba693dd214f6
2016-09-07 18:38:19 -07:00
Aaron Schulz
ab64cd7bd4 Flag internal page retrieve/save cycles with EDIT_INTERNAL
This is used to avoid edit stash checks and stats noise.

Bug: T136678
Change-Id: I6158b8b218240ef3875f2d1d2e8ca3bc2f69f980
2016-06-07 18:29:57 -07:00
Ricordisamoa
72bd3d545e Do not show useless form at Special:ChangeContentModel
If the choosen title cannot be converted to any of the available
models, show an error page instead of an empty and confusing dropdown
field asking for the new content model.

Change-Id: Idc7372a8870f98aa8148592385f3a837f16886f0
2016-05-04 17:42:06 +02:00
Pmlineditor
371f4e76d4 i18n of submit button on Special:ChangeContentModel
This patch adds a message, 'changecontentmodel-submit', for
Special:ChangeContentModel to prevent reuse of the default
"Submit" text from FormSpecialPage.

Bug: T120576
Change-Id: I72466867a6739ba144c5a2984b8ca2589292815c
2016-03-11 19:54:08 +05:30
Kunal Mehta
2b72964015 Improve change content model log entry for page creations
There really isn't a previous content model because the page didn't
exist beforehand, so say the page was created with a non-default
content model.

Bug: T128645
Change-Id: Ibe0b124e3f3ceaaf3775f82e2646b7639a146a42
2016-03-07 10:29:45 -08:00
Kunal Mehta
b51daafa5b Add help link for Special:ChangeContentModel
Bug: T128556
Change-Id: Id55a463cf6eac4f20e800ae49448e6007f68a3c4
2016-03-02 10:31:01 -08:00
Ricordisamoa
abacff63f3 Stop doing $that = $this in includes/specials
Closures support $this as of PHP 5.4

Change-Id: I452761a6189f50f93158f6de063d31c029bc2ed3
2016-02-17 23:25:58 +01: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
Stanislav Malyshev
027972a20f Include completion search into SearchEngine
By default it still uses PrefixSearch and supports PrefixSearchBackend
but it can be deprecated and phased out and SearchEngine extensions used
instead.

New APIs:
- SearchEngine
	public function defaultPrefixSearch( $search );
	public function completionSearch( $search );
	public function completionSearchWithVariants( $search );

Search engines should override:
protected function completionSearchBackend( $search );

Bug: T121430
Change-Id: Ie78649591dff94d21b72fad8e4e5eab010a461df
2016-02-03 23:41:49 +00:00
Aaron Schulz
7798b70e7e Define which SpecialPage classes expect write vs read mode
Bug: T123591
Change-Id: I521ebdd5e8eb8f7f4df927dc38732170aef2ac19
2016-01-14 14:40:37 -08:00
umherirrender
345356c747 No prefix suggestion of special and media namespace on special pages
As mention in comments of I71f77c3001a12d75b901807c20115cead9c64e93 the
added prefix suggestion can get called recursive.
Avoid this by disable prefix suggestion for media and special namespace,
because a special page cannot be used on that special pages.

Follows I71f77c3001a12d75b901807c20115cead9c64e93

Change-Id: I8978e3bd0783f62bc25b32a0fdaa90361abefcf3
2015-12-13 18:39:14 +01:00
umherirrender
95b432758c Allow auto suggestion for subpages of some special pages
The autocomplete search allows special pages to define the list of
subpages to be excepted. Fill up the function to show auto suggestion
for subpages of the following special pages:

Special:AllPages
Special:ChangeContentModel
Special:FileDuplicateSearch
Special:Movepage
Special:PageLanguage
Special:Prefixindex
Special:Recentchangeslinked
Special:Undelete

This makes it easier to navigate to this special pages with a prefilled
title/target field.

Change-Id: I71f77c3001a12d75b901807c20115cead9c64e93
2015-12-06 18:29:08 +01:00
umherirrender
f44bebc9ce Move Special:ChangeContentModel to the pagetools special page group
Acting on pages, so that group is better than the default of "other"
The group is shown on Special:Specialpages

Change-Id: I0d9734fa31775332fb8935bf4fc63ad3fb8a2852
2015-12-03 20:13:42 +01:00
umherirrender
c572d18661 Fixed spacing
- Removed space after cast
- Removed spaces in array index
- Removed double spaces
- Added spaces around string concat
- Fixed mixed tabs and spaces at begin of line

Change-Id: I38e849723f055d2d4c05cba72f5c245a28e8d5da
2015-09-26 20:44:54 +00:00
Kunal Mehta
2e69aaab1d SpecialChangeContentModel: Use autocomplete for title field
Change-Id: I766da59e6cbf7ed8f887d1a684ea9e284e9cf67e
2015-07-24 18:25:05 -07:00
Kunal Mehta
fa31bf1675 Add Special:ChangeContentModel
Special:ChangeContentModel allows for users with the 'editcontentmodel'
right to change the content model of a page.

Visiting Special:ChangeContentModel will contain an input field for a
page title. The user will then be sent to
Special:ChangeContentModel?pagetitle=<input> where the page title is
read only, with a content model selector and optional reason field.

The special page only allows converting between content models that
extend TextContent for simplicity. Advanced conversions should be done
via the API.

All content model changes via the special page or API generate a null
revision in the page history and a log entry at
Special:Log/contentmodel. The log entry has a revert link for
convenience (like the move log).

Bug: T72592
Co-Authored-By: Lewis Cawte <lewis@lewiscawte.me>
Change-Id: I296a67c09fcbc880c8c3a648eb5086580725ea46
2015-06-30 13:14:50 -07:00