Commit graph

30 commits

Author SHA1 Message Date
Umherirrender ebcc8ac7c5 Use new namespace for OutputPageBeforeHTMLHook
Change-Id: I7cb4a8db2d8473757434eff9476af62e310f91ad
2024-06-10 22:00:02 +02:00
Fomafix 9485ab50c4 Use namespaced PHP classes
Change-Id: I9f3a45c2d1ce4b7d7c5bb4bbbe382d32d47ee342
2024-06-07 09:08:55 +00:00
James D. Forrester fb383cc0f2 Replace wfGetDB() with ICP getReplicaDatabase()
Bug: T330641
Change-Id: Ic6ea216ff3365f88288d6a44b723e6dca0b15d49
2024-02-14 11:08:04 -05:00
Umherirrender b43ae79b22 Drop RL targets definitions from module definition, no longer honoured
Bug: T328497
Change-Id: I4cfef72003a11af2763d52428d72da012e34c69c
2024-01-23 21:56:06 +01:00
Umherirrender b626bd18d3 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statements done manually

Change-Id: I8e049e495a0d0f3a0e1ee02a8252354b12604bf9
2024-01-04 21:53:10 +01:00
thiemowmde 10a43a9ae3 Minor code cleanups in Hooks class
Change-Id: Ied3d5241df04b3fd070319070c0addfd3856e3bf
2023-11-16 13:59:24 +01:00
Umherirrender 46d9842652 Replace empty() with falsy check
empty() should only be used to suppress errors
When the type of the variable is array,
a falsy check is the same (checks for null, false and empty array)
Found by a new phan plugin (T234237)

Change-Id: I17e48498c9be9c542b48a9d77c5574fba9f38d4d
2023-10-21 21:58:58 +02:00
Sam Wilson ab3a80555b Inject MainConfig service to TemplateData hooks
Removes the global config variable.

Change-Id: I67c266a3f5189365de506230d1a7064a7427bff6
2023-09-25 10:40:05 +08:00
thiemowmde 8f81812242 Enable and enforce a few extra PHPCS sniffs
This is not really anything new. Most code already followed these
sniffs. This patch just fixes the remaining exceptions. Also:
* Remove PHPDoc blocks that don't add anything but just repeat the
  strict types.
* Remove @file comments in favor of class-level comments.
* Add strict types where possible, most notably some `void`.

Change-Id: Iff6872dff68170b0fc4e82ac2ba3cad385e8773e
2023-09-06 18:15:22 +02:00
jenkins-bot 4aaa893c4b Merge "Load GUI on action=edit if page has templatedata even outside NS_TEMPLATE" 2023-08-30 19:42:09 +00:00
Timo Tijhof 1f105ed5f6 Load GUI on action=edit if page has templatedata even outside NS_TEMPLATE
Bug: T189989
Bug: T300676
Change-Id: I372e29af7f14fba6ebc60bb6ea025b8e1015f2a7
2023-08-21 10:22:45 +00:00
gerritbot cfd2e5b664 Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I2a7aaadc47dd068ccea8fd8110054433973df52c
2023-08-19 18:11:41 +00:00
Umherirrender 8bd3dbc58c Use HookHandlers for core hooks
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.

Bug: T271031
Depends-On: Ic2d188d2c332ab8afeb5454fb5a956c8ba5670ae
Change-Id: Idf4cf94a0e4fae31a5c1f6c3dbf319c0d6913cd7
2023-08-15 13:03:15 +02:00
Thalia 855156c95f Hooks: Use UserIdentityUtils for temporary user check
Use instead of UserNameUtils, which has more dependencies.

Change-Id: If8c8687d360690368f9f07999a2baa7ee7a6ad61
2023-07-26 11:38:32 +01:00
gerritbot 2d16a7c72f Update moved class EditPage
See T321882. Moved in Ibefc44eb64aed

Bug: T321681
Change-Id: I9de606e32ac58ddbf68ee00587ee9b7f0f9f157d
2023-05-06 21:20:32 +00:00
Bartosz Dziewoński f2c89028bd Update TemplateDataEditor logging for IP masking
Bug: T332434
Change-Id: I9935e7d35b1cdb14c0958351cd84d9d6476d6363
2023-04-18 19:30:54 +00:00
thiemowmde 584fdcddf6 Extract serialization methods into TemplateDataStatus class
This makes the large Hook class quite a bit smaller.

Change-Id: I55229116eb16ccd9be21d1f34de5e52826ece2bf
2023-03-09 11:46:49 +01:00
Sam Smith 0f4d04e83f Use EventLogging::submit() to submit analytics events
EventLogging::logEvent() was marked as deprecated at the beginning of
2021 in I0cfd07295d4b51ca4805c79a28a9a4bd64ff7cc9.

Bug: T318263
Change-Id: I2d89784cc249e97954c9be05169f3060fd69945f
2023-01-30 18:20:16 +00:00
Ed Sanders 678d95251b Add an "Edit template data" button to the TemplateData output
This button, similar to an edit-section link, will launch the editor
and immediately open the TemplateDataGenerator UI.

Bug: T316759
Depends-On: Idb5e3c51a22361e0d9916d3c31444daeff310ed2
Change-Id: Ieb575c499c16d87c28972a55662ef0bd9cb72c06
2022-11-08 13:36:38 +00:00
WMDE-Fisch d1ffdc2b95 Remove $wgTemplateDataSuggestedValues feature flag
Feature is always enabled now.

Bug: T307188
Bug: T310684
Change-Id: Ic99c594ceec0020a6c9d20f0a4f10285b74ea9a8
2022-06-27 12:14:02 +02:00
Umherirrender 560819e270 Use WikiPageFactory to create WikiPage object
Bug: T297688
Change-Id: I5e6da574bd1377b492005adbc1aff3e97fe9c31b
2022-06-24 19:53:40 +02:00
Thiemo Kreuz ff7470e316 Add placeholder to avoid wikitext editor jumping down
Bug: T279869
Change-Id: Ic8f9bf7c95b42422dc4b477f9c752f5e89b20dc7
2022-04-25 08:42:59 +00:00
Thiemo Kreuz 1c8b4ae729 No HTML needed to validate <templatedata> in wikitext
I tried to benchmark this and yes, it makes a difference, but probably
not a big one. This is an additional parse in addition to the one core
will later do when the page is actually saved. For this one here we
are just not interested in the HTML.

Bug: T305105
Change-Id: I71147af5161c934a822651e80e11f3bd26af56cd
2022-04-11 18:29:51 +02:00
Reedy 5341749f56 Use namespaced EventLogging class
Change-Id: I87ed269b205e83ce87e5350ef31d35847a6ad25b
2022-03-06 16:07:22 +00:00
C. Scott Ananian 453c4152af ParserOutput::getPageProperty() now returns null when key is missing.
The return value of ParserOutput::getPageProperty() has transitioned
to returning `null` instead of `false` when the page property is missing.

Bug: T301915
Depends-On: Iaa25c390118d2db2b6578cdd558f2defd5351d15
Change-Id: I1126eab0e882b5bdfecea1ef6e3e27dca7b85115
2022-02-17 11:57:25 -05:00
C. Scott Ananian b87e24813e Update uses of ParserOutput::getPageProperty() to handle new return value
The return value of ParserOutput::getPageProperty() will transition to
returning `null` instead of `false` when the page property is missing.

Bug: T301915
Change-Id: I71628661b4539a4e35ae32846e719f92bcf782e0
2022-02-16 18:26:42 -05:00
Thiemo Kreuz 001494f443 Move last remaining HTML formating code out of blob class
Effectively a no-op. This patch doesn't change what the code does.
Tests are in place to prove this.

As before, the tests are intentionally not moved but left in place.
This is for later patches to clean up.

Change-Id: If130e0d006a36d8c755288f8a4e4e9a4c42a6295
2022-02-03 09:33:03 +01:00
WMDE-Fisch 8c36f324e1 Fix use of errorbox in TemplateData
Bug: T300349
Change-Id: Ic4dbc1235887f29cb7737c0e1d4a3efe047c719b
2022-01-28 15:17:07 +01:00
C. Scott Ananian 0a3b28d3de Passing a string to ParserOutput::addModules()/addModuleStyles() is deprecated
Bug: T296123
Change-Id: I9b7fe5acee73c3a378153c0820b46816164ebf21
2022-01-11 17:02:39 -05:00
Reedy 166812da07 Namespace extension
Change-Id: I779e97e512ec0c4f74fb6a4b706772fb1428e40f
2021-11-25 22:53:34 +00:00
Renamed from includes/TemplateDataHooks.php (Browse further)