| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Changes to the use statements and some additions
are done automatically via script
This also updates @covers tag for the namespaced classes
Change-Id: I859ba6d05018c99710b744e2becab432410d3bca
|
|
|
|
|
|
|
|
|
|
| |
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: Id75cb2e5fbee0fe7600f92473d876f23730d46b7
|
|
|
|
|
|
|
| |
It adds MediaWiki\Content namespace to WikitextContent
and two classes related.
Change-Id: Ib74e4c5b3edac6aa0e35d3b2093ce1d0b794cb6d
|
|
|
|
|
| |
Bug: T359241
Change-Id: I4f443b004b9ed77b9e6b8b1144d0cc2847a55d16
|
|
|
|
|
|
|
|
|
| |
This patch introduces a namespace declaration for the
MediaWiki\Content to JsonContent and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I44abb1ab5bd1fabf9886dc1457e241d7cae068bc
|
|
|
|
|
|
|
|
|
| |
This patch introduces a namespace declaration for the
MediaWiki\Content to TextContent and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: Ic251b1ddfcf6db9c85cb54cddf912aa827d2bc3a
|
|
|
|
|
|
|
|
|
| |
This patch introduces a namespace declaration for the
MediaWiki\Content to CssContent and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I6ab25787893cb2195f8cd2ba125ed8dd5a60de43
|
|
|
|
|
|
|
|
|
|
|
| |
In POSIX sh, `echo` flags are undefined. On macOS, this causes the
expected output to include literal `-n`s instead of the expected
behavior of not printing trailing newlines. So, use `printf` instead,
which should work consistently on both macOS and Linux.
Follows-up I5c506e3916285.
Change-Id: I54fc42d8fb8156fcf1d623ef4a7515092e634f09
|
|
|
|
|
|
|
|
|
|
|
| |
When running in a CI / Quibble context, this test class was
failing - it relies on other classes in the suite already having
initialised OOUI.
Explicitly enable OOUI in this test to avoid the failure mode.
Bug: T363797
Change-Id: I63c65d32b32f6e47b2b1900e819b58b9bbfe30c3
|
|
|
|
| |
Change-Id: I3632ce1ae00527f806652deb96cafb473aed3dcf
|
|
|
|
|
|
| |
Same as I710a077.
Change-Id: I2b8eaf060229da3e0b5035fc43e38d610d554535
|
|
|
|
| |
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
|
|
|
|
|
| |
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
|
|
|
|
|
|
|
| |
Changes to the use statements done automatically via script
Addition of missing use statements and changes to docs done manually
Change-Id: Ib326ae1e5c8409a98398c721e8b8ce42c73bd012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
== Skin::wrapHTML ==
Skin::wrapHTML no longer has to perform any guessing of the
ParserOutput language. Nor does it have to special wiki pages vs
special pages in this regard. Yay, code removal.
== ImagePage ==
On URLs like /wiki/File:Example.jpg, the main output handler is
ImagePage::view. This calls the parent Article::view to handle most of
its output. Article::view obtains the ParserOptions, and then fetches
ParserOutput, and then adds `<div class=mw-parser-output>` and its
metadata to OutputPage.
Before this change, ImagePage::view was creating a wrapper based
on "predicting" what language the ParserOutput will contain. It
couldn't call the new OutputPage::getContentLanguage or some
equivalent as Article::view wouldn't have populated that yet.
This leaky abstraction is fixed by this change as now the `<div>`
from ParserOutput no longer comes with a "please wrap it properly"
contract that Article subclasses couldn't possibly implement correctly
(it coudln't wrap it after the fact because Article::view writes to
OutputPage directly).
RECENT (T310445):
A special case was recently added for file pages about translated SVGs.
For those, we decide which language to use for the "fullMedia" thumb
atop the page. This was recently changed as part of T310445 from a
hardcoded $wgLanguageCode (site content lang) to new problematic
Title::getPageViewLanguage, which tries to guestimate the page
language of the rendered ParserOutput and then gets the preferred
variant for the current user. The motivation for this was to support
language variants but used Title::getPageViewLanguage as a kitchen
sink to achieve that minor side-effect. The only part of this
now-deprecated method that we actually need is
LanguageConverter::getPreferredVariant().
Test plan: Covered by ImagePageTest.
== Skin mainpage-title ==
RECENT (T331095, T298715):
A special case was added to Skin::getTemplateData that powers the
mainpage-title interface message feature. This is empty by default,
but when created via MediaWiki:mainpage-title allows interface admins
to replace the H1 with a custom and localised page heading.
A few months ago, in Ifc9f0a7174, Title::getPageViewLanguage was
applied here to support language variants. Replace with the same
fix as for ImagePage. Revert back to Message::inContentLanguage()
but refactor to inLanguage() via MediaWikiServices::getContentLanguage
so that LanguageConverter::getPreferredVariant can be applied.
== EditPage ==
This was doing similar "predicting" of the ParserOutput language to
create an empty preview placeholder for use by preview.js. Now that
ApiParse (via ParserOutput::getText) returns a usable element without
any secret "you magically know the right class, lang, and dir" contract,
this placeholder is no longer needed.
Test Plan:
* EditPage: Default preview
1. index.php?title=Main_Page&action=edit
2. Show preview
3. Assert <div class="mw-content-ltr mw-parser-output" lang=en dir=ltr>
* EditPage: JS preview
1. Preferences > Editing > Show preview without reload
2. index.php?title=Main_Page&action=edit
3. Show preview
4. Assert <div class="mw-content-ltr mw-parser-output" lang=en dir=ltr>
5. Type something and 'Show preview' again
6. Assert old element gone, new text is shown, and new element
attributes are the same as the above.
== McrUndoAction ==
Same as EditPage basically, but without the JS preview use case.
== DifferenceEngine ==
Test:
1. Open /w/index.php?title=Main_Page&diff=0
(this shows the latest diff, can do manually by viewing
/wiki/Main_Page, click "View history", click "Compare selected revisions")
2. Assert <div class="mw-content-ltr mw-parser-output" lang=en dir=ltr>
3. Open /w/index.php?title=Main_Page&diff=0&action=render
4. Assert <div class="mw-content-ltr mw-parser-output" lang=en dir=ltr>
== Special:ExpandTemplates ==
Test:
1. /wiki/Special:ExpandTemplates
2. Write "Hello".
3. "OK"
4. Assert <div class="mw-content-ltr mw-parser-output" lang=en dir=ltr>
Bug: T341244
Depends-On: Icd9c079f5896ee83d86b9c2699636dc81d25a14c
Depends-On: I4e7484b3b94f1cb6062e7cef9f20626b650bb4b1
Depends-On: I90b88f3b3a3bbeba4f48d118f92f54864997e105
Change-Id: Ib130a055e46764544af0f1a46d2bc2b3a7ee85b7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds new regex in BaseTextDiffer::localizeLineNumbers() to work with
wikidiff2 inline diffs as well as table diffs.
Since there are no "columns" in inline mode, we have a new message to
indicate how the line numbers changed from the old diff versus the new.
Deprecate DifferenceEngine::localiseLineNumbers() as no longer used and
redundant to BaseTextDiffer::localizeLineNumbers().
Bug: T346460
Change-Id: I7b195879b677e2242ad73070fe19ad82121576a8
|
|
|
|
| |
Change-Id: I11eace3d9823ca28a1d9a64f959f5f8ca2945821
|
|
|
|
|
| |
Bug: T166010
Change-Id: I4066885a7ea071d22497abcdb3f95e73e154d08c
|
|
|
|
|
|
|
|
| |
Remove `$wgShowDiffToggleSwitch`, ensure the inline switcher
is always shown.
Bug: T341630
Change-Id: I37d1abe0d9773654df24dd8316cd1b351e3b91a4
|
|
|
|
|
|
|
|
|
|
| |
And namesapce them:
- StreamFile
- OutputHandler
- OutputPage
Bug: T321882
Change-Id: Iedf8d88c595e580f2d8f0734c92aa5c45618ba33
|
|
|
|
|
| |
Bug: T341754
Change-Id: I3b7d71f811d7ebd0cf83273164c479762e1a680b
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: T341754
Change-Id: I17396985d0b26516a06df17e9bd1343054521e01
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Have Article opt in to inline toggle switch display, so that random
callers of DifferenceEngine::showDiffPage() do not receive a
non-functional format selector.
Bug: T342158
Change-Id: Id4e38c2a20b5381e5f70b1244304da2895eaf8e7
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fails with a
1) ManifoldTextDifferTest::testHasFormatExternal
ExternalDiffEngine config points to a non-executable
Change-Id: Ifb32694f2c1cef32a354e20636463a22b7ab5f6f
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It makes sense for SlotDiffRenderer to localize the diffs that it
returns.
DifferenceEngine can't conveniently use this right now since it stores
all slot diffs concatenated together in a cache entry. It can't break
the string apart again to call the right SlotDiffRenderer on each
slot diff. So it assumes there must be a text diff in there somewhere
and calls TextDiffer over the whole thing.
EntitySchema does not have this problem and can benefit from this
method.
Bug: T342209
Change-Id: Ie06e100bb0e945de5dbe3dade14b2e6b706e078d
|
|
|
|
|
|
| |
The code is there, so we may as well expose it.
Change-Id: Ic4cf5c0d4a5b46f0f0f25454815dcea1f69970eb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Follow the TODO comment in TextSlotDiffRenderer
::getTextDiffInternal() by moving the code out to three parallel
implementations, namely ExternalTextDiffer, PhpTextDiffer and
Wikidiff2TextDiffer.
* Add a container/factory class ManifoldTextDiffer to glue them
together and collate available formats.
* Move the inline legend to Wikidiff2TextDiffer. Not the toggle since
the ability to toggle depends on the available format, not the current
format.
* Update the diff cache keys so that ManifoldTextDiffer can store the
engine=>format map it used to generate the diff.
* Drop support for the second parameter to TextSlotDiffRenderer
::setEngine(), since nothing used it anymore.
* Provide a format batch API, since some engines are able to efficiently
generate multiple formats. This might be used by DifferenceEngine in
future.
Needs risky change notification for the cache key change.
Bug: T339184
Depends-On: I8a35b9b8ec1622c9a36d2496bdd24f51bc52c85f
Change-Id: I5c506e39162855aff53dd420dd8145156739059c
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
An integration test that checks for a regex match on the HTML output.
Achieves 92% coverage of showDiffPage.
Change-Id: I3b2af33257f2326b67ff6f0734aeff0da3b69f43
|
|/
|
|
|
|
|
|
|
| |
Using the OOUI class name is an established pattern outside of
OOUI widgets, so it's easier to stick with it for the diff page
hiding and showing (switching to and from inline/table diffs, etc.).
Bug: T324759
Change-Id: I805b6b71d8e137eaa3e000b15455557df42af838
|
|\
| |
| |
| | |
DifferenceEngine"
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
DifferenceEngine
getTablePrefix() is used to show the inline legend and inline switcher.
It is not yet part of a released stable interface.
Theoretically there may be multiple text slots on a page, and we don't
want multiple inline legends. There was already a fragment assembly
system, for the benefit of hook handlers, so move that up to the page
level, so that it can also deduplicate prefix fragments coming from
each slot.
Add tests.
Bug: T324759
Change-Id: I9baa5c24128c63bc318ba13e83a024843f4ab15e
|
|/
|
|
|
|
|
|
|
| |
When the old and new content object for a slot cannot be compared,
show an error message for that slot only, instead of throwing an
exception.
Bug: T214217
Change-Id: I6e982df358f85ca78f0448b3a93ded3f40676310
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Have data providers return plain data instead of objects.
* Use addDBDataOnce() instead of a DIY equivalent.
* Use a data provider instead of a loop in testMapDiffPrevNext and
testLoadRevisionData. Resolve the problem of the provided data
depending on auto-increment IDs from addDBDataOnce by using special
strings that are replaced with IDs in the test case.
Bug: T332865
Change-Id: Ie41f3222aa1b48c69dbfe4cd7f6ef84e394e31fa
|
|\
| |
| |
| | |
namespace"
|
| |
| |
| |
| |
| |
| |
| | |
I will address the dependencies on MW core in a followup.
Bug: T339184
Change-Id: I892364b0c9f15c9de4cfc29c683670c172d71764
|
|/
|
|
|
|
| |
PasswordSalt was dropped in 2e909bcb
Change-Id: I58d2b8d4e2a235afdc8054eafdea4e85b61f03c1
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.
Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.
Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
|
|
|
|
|
|
|
| |
The following sniffs are failing and were disabled:
* MediaWiki.Usage.ForbiddenFunctions.eval
Change-Id: I6fd0a9296c88a77c3abec6e5e8d568bb469c2d6e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is moderately messy.
Process was principally:
* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
xargs rg --files-with-matches 'Title\b' | \
xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix
Then manual fix-ups for a few files that don't have any use statements.
Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
|
|
|
|
|
|
|
|
| |
- No linking when the user cannot see the suppressed revision
- Double-strike the timestamp (b6f148b)
Bug: T325450
Change-Id: If94e9655d72e59a2b9d5147c5c2338e98f0ad163
|
|
|
|
|
|
| |
Test all situation with or without revision deletion
Change-Id: I9b490cb764853a85d4a0ab64b4c3118c34f71335
|
|
|
|
|
| |
Bug: T253628
Change-Id: I5c64f436d3cf757390b751ce3e34bfc7872bc176
|
|
|
|
|
|
|
|
| |
PageUpdateStatus provides clean access the the newly created
RevisionRecord.
Depends-On: Ia08c586198082ea47e8313d0d41835f9830fb29e
Change-Id: Id6963842321c4eaa3d7d029ad0b769f73433c103
|
|
|
|
| |
Change-Id: I1db7294635bb85e03841c4f7b100e2243ddf013b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Directories covered are:
- tests/phpunit/includes/cache/
- tests/phpunit/includes/changes/
- tests/phpunit/includes/changetags/
- tests/phpunit/includes/config/
- tests/phpunit/includes/content/
- tests/phpunit/includes/debug/
- tests/phpunit/includes/deferred/
- tests/phpunit/includes/diff/
Change-Id: I3a1f586867db7d57b177e13a03a4593f7eed09f4
|
|
|
|
|
|
|
|
|
|
|
| |
createMock() does the same, but is much easier to read.
A small difference is that some of the replacements made in this
patch didn't use disableOriginalConstructor() before. In case this
was relevant we should see the respective test fail. If not we can
save some CPU cycles and skip these constructors.
Change-Id: Ib98fb06e0fe753b7a53cb087a47e1159515a8ad5
|
|
|
|
|
|
| |
Avoid parsing known titles in tests to improve performance
Change-Id: Ibfccfe696f0b8bfda0b99abae324e60bbecef7d8
|
|\ |
|