Commit Graph

96 Commits

Author SHA1 Message Date
Niklas Laxström
7d20f15b17 Remove ULSMobileWebfontsEnabled
To my knowledge never used since it was added in in 2013 with
commit fd885d9881.

Bug: T332837
Change-Id: Ia9ecb3e4dd47b8ce4dfaaa489a1ec5a71c378492
2023-04-05 06:21:40 +00:00
NikG
613276ca89 ULS: Display "Page contents not supported" body in missing and talk pages
Instead of displaying the empty state for all non-content pages, we
should check whether the page is missing or if it's a talk page instead.

Also use the term "subject page" to align with existing functions
of Title and NamespaceInfo.

Bug: T316559
Bug: T326788
Change-Id: I0f50898b6e9817aee2bcfba38e69c67ae041a14b
2023-01-16 12:29:18 +02:00
NikG
965ffc3b1a Add language settings button inside dropdown for non-content pages
NOTE: This patch is identical to patch with change-id:
Ifdf2a529b30e5a2df8867b606a525c9f7b3bdb6c

The above patch has been merged but reverted because of the usage
of '$skin->getTemplateDate()' method, which should be avoided. The
current patch replaces the usage of this method, with the usage of
the output page title ($out->getTitle()). All the rest of the code
has been kept the same.

Bug: T316559
Change-Id: Ibef9f6fd46d9055c3e0865905fb8aa8d031c1940
2023-01-11 18:05:29 +02:00
Jdlrobson
570a7d3b4e Revert "Add language settings button inside dropdown for non-content pages"
This reverts commit 5d576d05b4.

Reason for revert: Using Skin::getTemplateData method outside the
skin rendering layer is dangerous and likely a performance issue as
it means generating the rendering data twice and makes various hooks
execute multiple times.
It has caused T326538 and may be causing other issues.

Bug: T326538
Change-Id: Ie5d079deae414eb199d2a40b98d04b57439eaac4
2023-01-09 20:25:46 +00:00
NikG
5d576d05b4 Add language settings button inside dropdown for non-content pages
Bug: T316559
Change-Id: Ifdf2a529b30e5a2df8867b606a525c9f7b3bdb6c
2023-01-09 05:02:57 +00:00
Umherirrender
9cdbe0ff44 Replace deprecated Language::getFallbacksFor
Bug: T325979
Change-Id: Iccc02c9646f9ba119bdfa0eb71c348b2346dda11
2022-12-29 17:56:50 +00:00
Umherirrender
61256e25b7 Use LanguageNameUtils::AUTONYMS/SUPPORTED instead of hard coded value
Easier to spot the documentation what happen with this option

Change-Id: I977485c2cba0063b5bdee3724d9262b75341faec
2022-12-29 13:41:24 +01:00
Umherirrender
7ea30c85bf Replace deprecated Language::fetchLanguageNames
Bug: T325962
Change-Id: I8d5724cd9b79639a0b2001759a70b8d8106c74ee
2022-12-27 17:22:26 +01:00
Fomafix
e44e4c4c0c Remove phpcs exclude rules and update PHP code
Change-Id: Ie37deda368a4d163cf324988721033829ae8af77
2022-11-13 18:33:34 +00:00
NikG
8a55528772 Compact language list preference should be ignored for Vector 2022 skin
The Compact language list preference was intended to control whether to
show all languages directly or show just a few of them (with option to
search for the rest) instead. However, with the new Vector 2022 skin,
there is only a button to access language selection and thus, this
setting should be ignored for this skin.

This patch modifies the "isCompactLinksEnabled" method inside Hooks
to always return true when the skin is set to Vector 2022 (when ULS
features are enabled).

Bug: T319690
Change-Id: Ic8a537d31ee4dad02932a04017f19537140e0c1c
2022-11-02 14:38:55 +00:00
Fomafix
35852fee74 Use WebRequest::getRawVal instead of WebRequest::getText
The UTF-8 normalization for the URL attributes `languagecode`, `uselang`
and `setlang` are not needed.

Change-Id: Ib204629fb15e2578bba09be4c40d0210eb81dd77
2022-08-24 06:19:52 +00:00
Jon Robson
06091efcd0 Limit ULSPosition check to non-Vector 2022 skins
I'm not sure what this is for, but it's definitely not needed
in Vector 2022 skin. It also prevents the uls-after-portlet-link
element from appearing inside the language button when ULS is disabled.

Bug: T275147
Change-Id: I8f6c1361040b72107f2d45bfc18e22d6b8f2021c
2022-07-28 04:32:43 +00:00
Abijeet
4632f33e6a Drop support for MediaWiki 1.36
Bug: T311510
Change-Id: I9bc2f91f274df1d37ebad639b42ee4b542274db9
2022-07-26 11:04:40 +00:00
Tim Starling
3524e733b9 Suppress PhanParamSignatureRealMismatchParamType on classes affected by new RL namespace
There is an alias, so there shouldn't be a problem in production. Phan
raises a spurious warning when the target version is PHP 7.2.

Bug: T308443
Change-Id: I75f1a1bd113a18c40236bd622b0eb76743432ceb
2022-05-25 02:47:45 +00:00
Thiemo Kreuz
78c25ebcf7 Fix-ups to comments and User interface usages
* Use isRegistered() from the more narrow UserIdentity interface.
* More specific type hints.
* Remove comments that literally repeat the code.

Change-Id: Icd0eaf8236be41b258efcf81d581540d2448e9e3
2022-04-20 09:54:25 +02:00
Reedy
f8eda0ca0c Use namespaced Babel class
Depends-On: I16411d99d97762606ed43e5a0093ff7ed1cfa0b8
Change-Id: I15ae2cd07b88991ed6f150e12af30bee9499dbdc
2022-03-06 14:41:56 +00:00
Reedy
430afafeb7 Use ExtensionRegistry to see if Babel is loaded
Change-Id: Iabc24b4580bab39a6d232d61e9c52a641cce41a3
2022-03-06 14:41:10 +00:00
Abijeet
6e6635bdbb Move version check inside PersonalUrls hook
Stop additional conditional hook if MW < 1.37, and move the check
to inside the hook itself

Bug: T299305
Change-Id: Ied1c5c0beee015d7b0a8d6bd750346f4a8a5aaa1
2022-01-24 09:24:43 +00:00
Abijeet
30986e6d9e Remove backward compatibility for MW <= 1.35
Bug: T298856
Change-Id: I1e635785d0a29d87f510e729b11fce9a2eb68e11
2022-01-18 12:51:07 +00:00
Reedy
f9532855ad Namespace extension
Change-Id: I79aa319f177589d85446888289568748cd63d1c5
2022-01-05 10:47:22 +00:00
Umherirrender
72c8cdb40b Use User object in UserGetLanguageObject hook only when safe to load
In case of error formatting the context language may set up before the
Setup.php is ended.

Bug: T267445
Change-Id: I4f07b30f75922884867bd14d654effc0e26a47f4
2021-11-29 13:59:30 +00:00
Fomafix
bd4a6f20a3 Update comment from addConfig to onResourceLoaderGetConfigVars
In f0c6bec1ac the function addConfig was
renamed to onResourceLoaderGetConfigVars.

Change-Id: I1fd7242b676e90366fbe5bfb95e6e0e3497b917f
2021-11-22 05:54:42 +00:00
Fomafix
c1a36d3490 Don't call isCompactLinksEnabled() twice in the same function
Store the result in a local variable.

Change-Id: Ie45c22c3af370b0cdcbe614497691b0bd849393f
2021-11-21 19:00:08 +00:00
Niklas Laxström
9cf8ca3305 Add apioutput to unsupported skins
There is nothing ULS can do here: there is no entry point to change
language or access settings, there is nothing to type.

One exception would be loading web fonts. But I would argue that
that is a small set of users, who can use Special:ApiSandbox or
the wiki help pages.

Bug: T145186
Change-Id: I71de2a58f007ff03b01c9edc5ed6bed0e6524c4e
2021-11-17 13:14:05 +00:00
Abijeet
defc3d416d ApiULSSetLanguage: Use LanguageNameUtils
Change-Id: I00e814894db4ba84f1d08c52db2993b59fbccf55
2021-11-16 18:36:23 +00:00
Abijeet
da4d965739 Replace usage of ApiBase::PARAM_* with ParamValidator::PARAM_*
Change-Id: I4c7c16f8b3380cdaf32fbedc9d33f12b14050774
2021-11-16 13:56:49 +00:00
Fomafix
f0c6bec1ac Use HookHandlers and inject services
This change also replaces the calls of deprecated functions from class
Language and replaces the global variables by the MainConfig.

Change-Id: Ice7273481a736cb138e263a9300bfd90fdcbb401
2021-11-04 14:00:31 +00:00
Fomafix
183bb97f74 ApiULSLocalization: Inject LanguageNameUtils
Replace deprecated Language::isValidCode by
LanguageNameUtils::isValidCode.

Change-Id: I2adef21fb37e78c163674008a4f9b1e5a74aa6a1
2021-10-29 13:14:31 +00:00
Abijeet
4d8131af10 MW 1.35: Re-add class attribute for ULS
Without the class attribute, the ULS does not open on MW <= 1.35.
This was changed in Ie9e30af5468aea9803d77c9a36e480ba2b2e86a0

Bug: T294021
Change-Id: I1bcf4e442e85f8848c5e4ff5609204602265b949
2021-10-28 08:08:29 +00:00
Daimona Eaytoy
005f7199ba Suppress taint-check false positive blocking CI
Bug: T294441
Change-Id: I8e060fa8cb7d90b742673a93a52f449920e1d6e9
2021-10-27 17:45:53 +02:00
Reedy
6f8763b3b2 Remove out of date comment in UniversalLanguageSelectorHooks::setVersionConstant()
PHP entry point is gone

Change-Id: I3f2093336a78fa081b4aee862788c793f586fb63
2021-10-07 02:46:33 +00:00
Reedy
b5ec74dc14 Use namespaced BetaFeatures class
Change-Id: I155ca6aa87160be29af1ee57bdd905314410bcf8
2021-10-01 14:38:47 +01:00
jdlrobson
9f92d7e759 Register meta data to allow Vector to handle display of this menu item
- Adjusts CSS to defer button/icon rendering to skins that support button
and icons e.g. Vector

Depends-On: Ib518858e06549f252d73d57fd4768f446cc561b9
Bug: T289630
Change-Id: Ie9e30af5468aea9803d77c9a36e480ba2b2e86a0
2021-09-03 19:21:21 +00:00
Jdlrobson
4c3907e61d Revert "Language button icon/button should be consistent with other buttons"
This reverts commit 5ca2ccb58a.

Reason for revert: Per Niklas's review (T289630#7324439)
I've also seen a much better way to do this which limits the change
to modern skins so I'll post a follow up shortly.

Change-Id: I99802c60390e23eaa0de21462788da622a35a37a
2021-09-01 15:35:05 +00:00
jdlrobson
5ca2ccb58a Language button icon/button should be consistent with other buttons
This converts the language button into a mw-ui-button which is the
class we're currently using in both Vector and Minerva. In future
this can become a WVUI button using the same roadmap as Vector
and Minerva.

This fixes the issue with the icon resize, as well as the issue
with the button lacking appropriate hover/focus states.

Bug: T289630
Change-Id: I8242986e8762a8f663f8cab07c54481e14223320
2021-09-01 08:05:54 +00:00
Alexander Vorwerk
0d9e1b134a Avoid using User::setOption()
User::setOption() is deprecated and should be replaced with
UserOptionsManager::setOption()

Bug: T277818
Change-Id: I5ac58c4be5046d4457de24b63b062aa238e972b6
2021-08-16 06:00:28 +00:00
Alexander Vorwerk
77b61af6b8 Use constant MW_VERSION instead of deprecated global $wgVersion
Change-Id: I60647666d04b43d2cb01ff33310a325fba9bc325
2021-08-13 03:03:03 +02:00
Niklas Laxström
36d79be608 Remove ULSEnableAnon
I am not aware of anyone using this niche configuration where ULS
visible interface is enabled only for logged in users. Simplify
code and updated comments.

Change-Id: I9f0a5969fdc76ca790d961ee3035fdb27ece9c0c
2021-08-09 23:25:01 +05:30
Niklas Laxström
03d099eddc Fix regressions in ULS entry point setup
* Link in preferences is again opening ULS
* "personal" entry point now works even with compact languages
  preference disabled

I added lots of comments and refactored this code to give things
better names to make this code easier to understand and maintain
and hopefully reduce the amount of bugs in the future.

Bug: T282956
Bug: T286574
Change-Id: I9cd6776ea6664e33fd63c49dfa77c5f004fba799
2021-07-16 19:23:34 +00:00
jdlrobson
09a2b33bd6 Restore compact languages button user preference
The compact languages button user preference will be applied to
any compact language button provided by the skin, this allows users
to opt out of the feature as before.

This will be used immediately in Vector in
I436554d9d51470d277d59c2c71e08124735e12fd

Bug: T282149
Change-Id: I726c61d4c6895a28b999781752535e0ddc961744
2021-06-14 15:24:53 +00:00
jdlrobson
2c46226f83 Use SkinTemplateNavigationUniversal for ULS button
As part of the desktop refresh, we are moving towards a universal
hook for adding menu items. This allows more control over placement
without breaking backwards compatibility.

In modern skins, the personal URLs bar is split into
user-menu and notifications options which are combined for legacy
skins.

Depends-On: If4805e5186756056afcd31d21919e907a7782ce8
Bug: T282196
Change-Id: I79fa85e67d9c0064dd4dc9437517264d5fc04140
2021-06-07 20:40:14 +00:00
Abijeet
5baf437b3c Remove MW 1.34 backward compatible code
Move hooks and scripts to extensions.json

Bug: T282783
Change-Id: Id63d17d04789bb36fff35e0512e7878dc8bfe12c
2021-06-01 08:17:13 +00:00
libraryupgrader
b556ff5878 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

npm:
* lodash: 4.17.19 → 4.17.21
  * https://npmjs.com/advisories/1673 (CVE-2021-23337)
* hosted-git-info: 3.0.7 → 3.0.8
  * https://npmjs.com/advisories/1677 (CVE-2021-23362)

Change-Id: If4b6b21986aaa05e3d33fcca6e35374a2eae1830
2021-05-07 15:52:15 +00:00
ZabeMath
cb4c7a13b6 Avoid using User::getBoolOption()
User::getBoolOption() is deprecated and should be replaced with UserOptionsLookup::getBoolOption()

Bug: T277600
Change-Id: I119f9ed8a2f81af2a7f3ac6743e4af239f7ca61d
2021-04-02 02:22:13 +00:00
Sam Smith
852d72e66d Remove UniversalLanguageSelector instrument
Per T275894, Readers Web intend to increase the scope of the
UniversalLanguageSelector instrument to help them understand how
users are interacting with the Languages list in sidebar.

In order to keep the UniversalLanguageSelector extension focussed and
not overly Wikimedia-specific, it was agreed that the instrument would
be migrated to the WikimediaEvents extension, where other such
instruments are located.

Therefore, remove all code related to the UniversalLanguageSelector
instrument.

Bug: T275894
Depends-On: I2acee8ba8dc59c497dc6ba42cd5bd88dfd985c8b
Change-Id: I72b1d0ff35488521b3499e9606efee26baff8c00
2021-03-04 13:58:19 +00:00
jdlrobson
96656c5f41 Allow access to display and input settings in new vector
Light refactor of existing code into reusable method to support
this.

Use Extension attributes to allow skins to provide ULS
additional configuration.

Bug: T274396
Change-Id: I7dcd49f05fae83fbc0c15768bee8ca93eab17bcc
2021-02-22 11:02:10 +00:00
James D. Forrester
9fc9dbafa3 Use User->isRegistered(), not deprecated isLoggedIn()
Bug: T270450
Change-Id: Ibeb882b8917f43aed9fd2411a6d4a2400532da33
2020-12-18 22:16:26 +00:00
jdlrobson
d69d5773e5 Compact language links module is loaded via server side
This provides an alternative mechanism to
I0518ecdf402ebf5eb6bad2c430f6462322c0d8e1 for loading the compact
language link module. Instead of relying on the client, the HTML
is inspected.

Bug: T264824
Change-Id: I977a998388b3e70f7fe4d97fa05be3c1ac1bf676
2020-11-18 17:07:59 +00:00
jdlrobson
ab6decae11 Allow skins to register their own button and disable compact
Example usage:
Iabd4688c6081b4de391b9655b92a16f3a414e018

We will skip loading the compact link if we don't need
to compact the languages.

Note special handling is known for Timeless which stops
propagation of events. This will be fixed in Timeless at a
later date.

Bug: T264824
Change-Id: I0518ecdf402ebf5eb6bad2c430f6462322c0d8e1
2020-11-18 17:06:40 +00:00
Niklas Laxström
98f0bb42bd Remove ULSCompactLinksForNewAccounts and ULSCompactLinksEnableAnon
These are disabled by default and on production. They are only enabled
in the beta cluster, which is not needed.

Change-Id: Ifa847fd8a1f3d7d2695a7c1c4a1a93f136091604
2020-10-14 13:02:25 +00:00