Commit graph

1618 commits

Author SHA1 Message Date
Bartosz Dziewoński
25b40324f1 Remove SpecialPageAction and associated logic, route old URLs
Bug: T323338
Change-Id: I115ace5e82f55fd6652d61f05926e96ba569a8a9
2023-07-11 19:22:51 +00:00
Jon Robson
51c6fe6167 Login page: Use Codex CSS components
Changes:
* Use Codex markup instead of mediawiki ui markup
* We limit what can be customized by the skin
* Current rules for touch area and snapping of
inputs is moved from Minerva into core so other skins
benefit from the styling
* A placeholder text is adding to the "real name" field.
* Introduce CodexHTMLForm

Bug: T182050
Change-Id: I834cc0e07fc1e705753df6866a5eeda2ac77fb8e
2023-07-06 17:20:17 -07:00
thiemowmde
99230a7f72 Fix backwards compatibility alias for WordAccumulator
This was a mistake in I892364b. Unfortunately the codebase was in a
confusing state with many classes in no namespace. But this class was
in one.

Bug: T339184
Change-Id: Id31b9f53ffb6483c1901db8ab26fcb40368ec074
2023-06-26 16:30:51 +00:00
jenkins-bot
db8c4b0699 Merge "Improve handling of diffs between incompatible content models" 2023-06-26 01:06:58 +00:00
Gergő Tisza
a9e0562cfb Improve handling of diffs between incompatible content models
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
2023-06-23 19:09:59 +00:00
jenkins-bot
8647f03800 Merge "Convert PageRedirectHandlerTrait to PageRedirectHelper" 2023-06-23 13:05:51 +00:00
jenkins-bot
923cbd131c Merge "Add maintenance/storage/fixLegacyEncoding.php" 2023-06-22 23:27:24 +00:00
Amir Sarabadani
bad7b08883 Add maintenance/storage/fixLegacyEncoding.php
To fix legacy encoding entries in external storage which means they
can't be fixed via calling moveToExternal.php.

The script originally was copy-paste and clean up of moveToExternal.php
but it made so much duplication that I went with subclassing.

Bug: T282734
Change-Id: Ic52e843f3dbe7d14cc8df5e8f3fe7aada7681bc9
2023-06-22 09:59:01 +02:00
Ammarpad
b6becee5eb Remove deprecated SkinTemplateNavigation hooks
- SkinTemplateNavigation hook
 - SkinTemplateNavigation::SpecialPage hook

Bug: T339969
Change-Id: I0aa4a593ae5c795ca2f75234f379e5ad0efa48aa
2023-06-21 23:20:01 +01:00
jenkins-bot
de6ea8d050 Merge "Populate parser cache with parsoid output." 2023-06-21 15:14:07 +00:00
daniel
5bc235c966 Convert PageRedirectHandlerTrait to PageRedirectHelper
Using a helper object instead of a trait allows for dependency
injection through PageRestHelperFactory. This will make it easier to add
language variant redirects in the next step.

Change-Id: I1d4f26c380797e28e1b97051400bb9b1301b89ab
2023-06-20 21:15:24 +02:00
jenkins-bot
bdb701a634 Merge "Move DiffEngine and helpers to includes/libs/Diff and put them in a namespace" 2023-06-20 19:03:46 +00:00
rrana-wmf
5488772c5f Populate parser cache with parsoid output.
The --force option is supported. NOTE: Without supplying any
arguments/options, the script will run for all pages in the wiki.

TODO: Run for all pages in batch sizes, so things don't explode
      if we have so many pages.

Bug: T338922
Change-Id: Id894f4769ad6f20137b13143178f50f227d7481a
2023-06-20 14:45:42 +03:00
jenkins-bot
b63c42015c Merge "mail: Round 6 of EmailUser refactoring" 2023-06-20 11:23:50 +00:00
Daimona Eaytoy
c7eb0db5d1 mail: Round 6 of EmailUser refactoring
- Rename methods to follow the more standard convention used for
  commands.
- Update doc comments.
- Add new hooks with final method names and parameter types, to replace
  the old messy hooks.
- Deprecate the remaining old hooks.

Bug: T265541
Change-Id: I609709a70fb58ce00b9f179ee4de2f6ac5e0a1cf
2023-06-20 11:00:07 +00:00
Tim Starling
5127bb2f78 Remove RangeDifference
RangeDifference was introduced in 89f8141a7 (2008) by Guy Van den
Broeck as part of his experimental "wikidiff3" engine.

Wikidiff3 was mostly removed in dcac5f19 (2009), although the Wikidiff3
class itself remained until 20f066e97 (2016) when it was merged into
DiffEngine. The merge left diff_range() as an unused method with no
visibility modifier being the only caller of RangeDifference. "private"
was eventually added, and then finally the unused private method was
deleted, leaving no callers in core or extensions.

Change-Id: I11fd03b9b36449620518b94e2c4be02da32d1271
2023-06-20 10:53:39 +00:00
Tim Starling
359ce91a12 Move DiffEngine and helpers to includes/libs/Diff and put them in a namespace
I will address the dependencies on MW core in a followup.

Bug: T339184
Change-Id: I892364b0c9f15c9de4cfc29c683670c172d71764
2023-06-20 15:15:13 +10:00
jenkins-bot
b48bfcdb85 Merge "Create new TempUserBanner skin component" 2023-06-16 17:33:49 +00:00
Jan Drewniak
62196c2fa1 Create new TempUserBanner skin component
Creates a new skin component for informing users with
temporary accounts that they can login or register if they choose.

Adds:
- New skin component: SkinComponentTempUserBanner.php
- Skin feature: "temp-user-banner"
- Associated styles
- New i18n messages for banner

NOTE: This component is not registered via the skinComponentRegistry
because it doesn't output any data, only a string of HTML.
Instead it is appended to the body element before the skin is rendered.

Bug: T330510
Change-Id: I1e137dbd29f3c73efac901f43f8a8258e2a111fc
2023-06-16 16:50:06 +00:00
jenkins-bot
c1c4fe771a Merge "Make some storage scripts use Maintenance class" 2023-06-16 02:52:40 +00:00
daniel
34d73531cb Make some storage scripts use Maintenance class
CommandLineInc is deprecated. This allows the scripts to be executed
from MaintenanceRunner.

Change-Id: I180605ea5cb47783670b28a6f01d98f0398c705d
2023-06-14 22:36:35 +02:00
Ryan Schmidt
209a2d7af1 Create shared interface for foreign db repos
Right now, Extension:TimedMediaHandler hardcodes checks for
ForeignDBViaLBRepo, which makes it inoperable for wikis making use of
ForeignDBRepo or an extension-provided foreign repo that exposes direct
access to the remote MW database. Introducing a new interface in core
will allow TimedMediaHandler to check for this interface instead of
specific implementations of foreign db repos.

I wasn't quite sure what methods to populate the interface with, since
all current implementations extend from LocalRepo, and most things that
interact with it largely expect (close to) the full API surface that
LocalRepo provides. Rather than duplicating all of those methods in the
interface, I opted for providing two methods that any custom
implementations would be required to override should they extend from
LocalRepo as a base class. I'm open to other approaches here, however.

Bug: T63986
Change-Id: I76b43e77f44e90eef5f3d2ac05ef203ed3085bd2
2023-06-13 22:38:34 +02:00
Winston Sung
ab1a809acc Revert "Implement Language Converter for yue (Cantonese)"
This partially reverts Iee936baa0a42370a723b34b09a791bf0917dcdf4
 (commit 504c1a9faf).

Bug: T59106
Change-Id: I935cc23cbc2838c4338c5fb2220d8ec4cfb750a9
2023-06-13 05:35:54 +00:00
Alexander Vorwerk
e9211f153e Namespace EventRelayer and EventRelayerNull
Change-Id: I648998172e2b20328d043bfb5866df4486357250
2023-06-11 00:15:46 +02:00
Alexander Vorwerk
8b754c90cf Reorg: Move EventRelayerGroup to libs/eventrelayer/
Bug: T321882
Change-Id: Ic00f83d127845f99acca9c1f8907db7c6dc03b9e
2023-06-10 12:30:12 +02:00
Daimona Eaytoy
44e8c7885b media: Replace deprecated MWException
Introduce new classes for checked exceptions.

Bug: T328220
Change-Id: Idbcdc09647a857e359e41ecec98212a8937c5c2e
2023-06-09 18:51:07 +02:00
jenkins-bot
9c31221bd8 Merge "site: Simplify SiteList by removing GenericArrayObject indirection" 2023-06-06 19:42:39 +00:00
jenkins-bot
b19d11d8bc Merge "diff: Add legend and tooltips to inline diff display" 2023-06-06 17:43:28 +00:00
Timo Tijhof
90e2ed6ccb site: Simplify SiteList by removing GenericArrayObject indirection
== Background ==

In 2012, commit afe46f1403 (Id7e9b59c7e) added libs/GenericArrayObject
along with an (unused) abstract GenericArrayObjectTest case.

The same code was also added to the Wikibase extension with
change 6347b35a55cd (Ifa7f1dc702).

The code was then factored out from Wikibase into the wmde/Diff
library.

In 2013, GenericArrayObject was removed from wmde/Diff in the commit
at https://github.com/wmde/Diff/commit/d9c2bd5c140e2a783fd42298db6c.

== This change ==

Remove the GenericArrayObject indirection from SiteList as there exist
nothing outside SiteList refering to it in Codesearch Everywhere, and
even in SiteList much of the code in GenericArrayObject is overridden,
unused, or otherwise needlessly indirect.

Change-Id: Ifea09c5de50af1616058d8baa9037db273dfb0e5
2023-06-05 19:39:33 +00:00
Amir Sarabadani
9606086c4c Reorg: Move Pingback to installer/
It shouldn't be in directly in includes/

Bug: T321882
Change-Id: I3c738cf65def049f7a5b128e8957de672f7bd072
2023-06-05 09:42:57 -04:00
jenkins-bot
8ffdf1a72f Merge "Introduce EmailUserFactory" 2023-06-03 13:20:01 +00:00
Timo Tijhof
cbd25621f4 rdbms: Move IDBAccessObject from /includes/dao/ to /libs/rdbms
* Is generally useful for Rdbms consumers.
* Has no dependencies besides stable constants and interface from Rdbms.
* Is generic, i.e. not specific to MediaWiki in its naming, purpose,
  or required domain knowledge.

Current rationale is that "dao" is not a recognised component
in MediaWiki core. Its super tiny and a handful of changes in over a
decade, so seems overkill to make a big deal out of it by creating a
whole new component for it in all the usual places. Yet, having it
fall into a gap with no owner for issue tracking, code review, no
documentation, and no definition of what this directory is for
exactly, is also counter-productive. Hence, finding a suitable place
for it.

Change-Id: I8cbb9ebfa8873085a30cb355e3299493538006ae
2023-06-01 13:38:28 +01:00
Daimona Eaytoy
b469b342d0 Introduce EmailUserFactory
This is necessary so that EmailUser can behave as a command. EmailUser
now takes the performer as a constructor parameter; this, in combination
with the statelessness of the service, allows it to be reused for
multiple sends. Some BC code was also moved to the factory.

Bug: T265541
Change-Id: I2568359f00f429ef3ab3bfbfb803dc8e51cd8add
2023-06-01 11:17:44 +00:00
Sam Wilson
1eb586013c diff: Add legend and tooltips to inline diff display
Add a legend at the top of the inline diff display, showing the
meanings of the colours of the inserted and deleted highlighting.
Also add the same text as tooltips on the highlighted elements.

The legend is added as part of a new area above the diff table
that can be modified via a new TextSlotDiffRendererTablePrefix
hook, so that extensions can add other buttons etc. there as
required.

This is a follow-up to the previous attempt, which added the
legend in DifferenceEngine::showDiff() and was called from
too many places. This patch moves it to be called in
DifferenceEngine::showDiffPage().

Bug: T324759
Change-Id: I2a3c67bcfa47313dee597e602a62073e4e298cd2
Follow-up: I6de30bf79eb5ac262285951792782b870d075e00
2023-05-31 15:43:28 +10:00
DannyS712
07af42e199 Add DeferredUpdatesManager service to replace DeferredUpdates
This patch doesn't deal with the injection of dependencies
and removal of the global state, but rather moves the code
from DeferredUpdates to the new service essentially as-is,
to simplify review. The changes to inject the various
services needed and make DeferredUpdatesManager a proper
service will be done in follow-ups, to make them easier
to follow.

While almost everything is changed from static to non-static,
DeferredUpdates::$scopeStack remains static as
DeferredUpdatesManager::$scopeStack, just in case multiple
versions of the service are created, to ensure that no
updates are missed.

Bug: T265749
Change-Id: I7f07eddf2fc399b15db4fe9be4c792ef8eb0747b
2023-05-29 03:59:03 +00:00
James D. Forrester
27bd40d679 Namespace SpecialMy* under \MediaWiki\Specials\Redirects
Change-Id: I1c4473b3c75a4a5095b26d825b1f2f1f093d728a
2023-05-21 13:16:04 +03:00
James D. Forrester
c6eadd8d32 Namespace SpecialM* under \MediaWiki\Specials
Change-Id: I3f733dcef861f26e0938185605f88c0e316a9291
2023-05-21 12:07:04 +03:00
Liangent
504c1a9faf Implement Language Converter for yue (Cantonese)
This only implement unidirectional yue-Hant => yue-Hans per community consensus.

Bug: T59106
Change-Id: Iee936baa0a42370a723b34b09a791bf0917dcdf4
2023-05-20 16:11:11 +00:00
Lt2818
e69ed0fee9 Implement Language Converter for wuu (Wu)
Bug: T59138
Change-Id: I62507198ad4e467bf4c09f3545ce77188f47903e
2023-05-20 15:14:41 +00:00
jenkins-bot
db3053faf6 Merge "Introduce ChangeTagsStore service and move some functions of ChangeTags" 2023-05-19 08:58:27 +00:00
Samtar
2ba3afbd47
Revert "diff: Add legend and tooltips to inline diff display"
This reverts commit 19eb61de66.

Reason for revert: Reworking

Change-Id: I2bc524254d10d6612c5b0a7db95dd6af5f60ccaa
Depends-On: I5c3d7df530eb6fc09ba380d42a81b17511861308
Depends-On: I60784afa0d47e22acd9e8a981092784c84b250eb
2023-05-18 15:50:59 +01:00
Func
942d288f52 Implement HTMLToggleSwitchField for mobile layout of preferences
This is the more native way of doing things, which avoids syncing
different states between the toggle and the hidden widget.
The DOM structure is also better and don't confuse screen readers.

Bug: T333496
Bug: T334705
Bug: T336107
Change-Id: I47de69459b96f172153065094eb4113584bb435a
2023-05-18 02:23:28 +08:00
Bartosz Dziewoński
6a20dc29ae editpage: Split off producing edit intro messages and preloaded content
Introduce two new classes, containing code split off from EditPage:
* IntroMessageBuilder (edit notices and other intro messages)
* PreloadedContentBuilder (initial text of new pages / sections)

I'm doing both of these features in one change, because they share a
lot of code. They are meant to be used by alternative editors to
support all of the features of the MediaWiki edit form. This isn't
everything you need yet (we should at least do this for the edit
checkboxes too), but it's a step.

Bug: T201613
Change-Id: If0b05710cb52a977bf4e85947d72d68683a0a29e
2023-05-16 20:51:00 +02:00
Amir Sarabadani
b5ccd131d6 Introduce ChangeTagsStore service and move some functions of ChangeTags
Better DI, cleaner code, etc.

Way more needs to be moved but let's avoid exploding the patch.

Bug: T245964
Change-Id: I63b0f60187250fabf4d17c80a794877f07d2b1a2
2023-05-16 16:25:44 +01:00
Umherirrender
11d4d33e08 Remove deprecated WatchlistNotificationManager class alias
- class MediaWiki\User\WatchlistNotificationManager
- MediaWiki\MediaWikiServices::getWatchlistNotificationManager

Change-Id: I334f10e814b2bf9ef3de6f6ea3ed5ae4ad402ae0
2023-05-13 09:55:45 +02:00
jenkins-bot
c349002235 Merge "ResourceLoader: Allow FileModule scripts to be generated with a callback" 2023-05-10 02:19:38 +00:00
jenkins-bot
acfd4540b5 Merge "maintenance: Rename generateLocalAutoload to generateAutoload" 2023-05-09 16:01:58 +00:00
Tim Starling
a59c446154 ResourceLoader: Allow FileModule scripts to be generated with a callback
To implement source maps, we want FileModule::getScript() to return
an array with path information, but that would break subclasses of
FileModule which concatenate to the return value of parent::getScript().
So allow scripts to be generated by a callback, eliminating the need for
concatenation in subclasses.

* Factor out most of the loop body of expandPackageFiles() into
  expandFileInfo(). Add 'name' to the return value. Ensure 'filePath'
  is always a FilePath object since we need that to safely return it
  to ResourceLoader later. Document the return value.
* Make sure the base path is always set in FilePath objects returned by
  expandFileInfo().
* Factor out the loop body of the final stage of file info expansion
  into readFileInfo(). Retain filePath, do not unset it.
* Assert that $fileInfo['content'] is definitely set.
* Convert array_map() in getDefinitionSummary() to a loop.
* Migrate LanguageDataModule.

Bug: T47514
Change-Id: I97d61b5793159cea365740e0563f7b733e0f16de
2023-05-09 11:47:40 +10:00
jenkins-bot
a697d50bcb Merge "rdbms: Move ReadOnlyMode and ConfiguredReadOnlyMode to rdbms library" 2023-05-05 00:15:27 +00:00
Amir Sarabadani
623d3dc419 rdbms: Move ReadOnlyMode and ConfiguredReadOnlyMode to rdbms library
The db/ directory does not have an owner and it's a mess in general.
These classes don't depend on anything in core except the rdbms library.
Let's simply move it there. In other words, Krinkle made me do it.

Since the class was moved in I6202e52ba73 merged less than a week ago,
no need to alias anything.

Bug: T321882
Change-Id: I24ceeb8bf765a50f441270136acd612359d50aa2
2023-05-04 23:41:21 +02:00