Commit graph

96 commits

Author SHA1 Message Date
Amir Sarabadani 725bd574d7 Don't call saveOptions in Hooks::onAccountCreated
It is causing deadlocks because after hook being called and done, core
itself calls saveSettings(). See:
a2e5997a4c/includes/auth/AuthManager.php (1515)

Bug: T306636
Change-Id: I5ded25f56a58bf89b894a8fdd6d8200fb378eb75
2022-06-01 14:19:15 +02:00
gerritbot dedcbc2fbe Fix usage of ApiBase::PARAM_* deprecated constants
The ones that are replaced with ParamValidator

Bug: T275455
Change-Id: I8e022b0df8e10bce39cecc34dde2f74a486f2aa6
2022-04-04 01:30:00 +02:00
gerritbot b76da576d9 Replace deprecated ApiBase::PARAM_ with IntegerDef ones
The rest of ApiBase::PARAM_  will be done in separate patches

Bug: T275455
Change-Id: Ia12b3578ee820fe366baf7b0c5e049ebde1d0de5
2022-04-03 22:16:45 +02:00
Umherirrender 778980cba6 Replace deprecated User::newFromIdentity with UserFactory
Moved the factory deeper into the code right before the one usage it
still needed a full user object.

Narrow done method arguments from User to UserIdentity
and use the identity directly

Change-Id: I2231db43f525a74e93dba8ea5865b256efd2dfce
2022-02-11 20:35:47 +00:00
Ed Sanders 1daf4bcf2d build: Update eslint config
Change-Id: If0871326eb35f8cb6ef026784cd04fca5754ab59
2022-01-25 22:01:31 +00:00
Matěj Suchánek 88b9e21e7a Don't throw away '0' edit summary
Change-Id: I73e07adff39a657a11fbab37716e1cbc17f2f255
2021-11-22 13:39:09 +00:00
libraryupgrader b33de1c9c6 build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: I9ca8baea50bee5b1f48744bb1ba3520421b8543a
2021-09-09 17:45:10 +00:00
libraryupgrader 56e6d0d365 build: Updating mediawiki/mediawiki-codesniffer to 37.0.0
Change-Id: Ic46650ca7e95698d6c2ee045a62a3f4115c14a2d
2021-07-24 06:11:02 +00:00
Tim Starling 8fdb3aca5e Fix history tools performance
Thanks was causing history views to do 4 DB queries per row, due to the
RevisionStore::getPreviousRevision() call. The reason for doing it is
that it doesn't make sense to thank someone for a diff which includes
multiple authors. This does not apply to history pages -- even for
filtered history views, you can thank someone for a specific revision on
the basis of its edit summary.

So, distinguish between history tools and diff tools. Do the expensive
thing only for diff tools.

Bug: T284274
Change-Id: Ib631100b82958065a327dd18c927af4a78b8be15
2021-06-29 13:01:05 +10:00
Thalia aa917f42e4 ApiFlowThank: Prevent thanking from Flow if partial blocked against thanks
Die earlier from ApiFlowThank::execute if them user is blocked from
Thanks, now that it is possible to have a partial block against Thanks
without being blocked from pages.

Follow-up to Id86d97a38c041fea4abcdbdd404428622df76669

Bug: T242785
Change-Id: Ia3683c3cab333b1193b2b77c6c18b5c343b5a5c7
2021-05-14 13:01:58 +01:00
jenkins-bot 93978d58d3 Merge "ApiCoreThank: Ensure partial block against thanks applies to revisions" 2021-05-13 19:37:58 +00:00
Thalia 60a879650d ApiCoreThank: Ensure partial block against thanks applies to revisions
Die earlier from ApiCoreThank::execute if them user is blocked from
Thanks, now that it is possible to have a partial block against Thanks
without being blocked from pages.

Follow-up to I290a7c39c6fcb22a8ab4a9ecbad76a239cb18ea0

Bug: T242785
Change-Id: Id86d97a38c041fea4abcdbdd404428622df76669
2021-05-13 19:57:51 +01:00
James D. Forrester da091690f1 Replace uses of DB_MASTER with DB_PRIMARY
Change-Id: Ic23cf2910afee9305587fa97d6e548bae0d2c721
2021-05-13 08:31:40 -07:00
jenkins-bot 7a170b639f Merge "Allow partially blocking giving thanks" 2021-05-13 12:43:55 +00:00
STran 43dd004a62 Allow partially blocking giving thanks
- Add hook to enable blocking thanks
- Check if user is blocked from 'thanks' action
  and disable giving thanks from  API and UI if so

Bug: T242785
Change-Id: I290a7c39c6fcb22a8ab4a9ecbad76a239cb18ea0
2021-05-12 13:06:09 -07:00
Tim Starling 49c82e02e5 Stop using legacy ActorMigration field "log_user"
Use ActorNormalization, introduced in 1.36.

Bug: T278917
Change-Id: I20b26ded92824db5f7d12cd354571f656600cc4b
2021-04-20 15:09:02 +10:00
ZabeMath f36a08e6bc Avoid using User::setOption()
User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption()

Bug: T277818
Change-Id: Iacc258705c4517c958a2568e47ba4f43963acc2e
2021-04-02 19:22:40 +02:00
Reedy 3749db7eba Namespace extension
Change-Id: Ic9e0b8d6b3cc6b9be4d6b026cb0a3b4a12aef38f
2021-03-20 18:22:17 -07:00
Reedy 4329060a7b $wgThanksLogTypeWhitelist has been replaced by $wgThanksAllowedLogTypes
Bug: T277963
Change-Id: I7ebc669b353bf6097cbcee3aca186d46419bb5c7
2021-03-20 04:43:48 +00:00
Umherirrender 545208c01b Use ::class for class names in Echo config
This makes visible where the classes are used

Change-Id: I166d5981f1fb8a0441e59bf29c0e0649d6d0f3d2
2021-03-06 21:00:09 +00:00
Umherirrender 35ee72248c Move userTalk-constructive icons from root to modules
Store all SVGs in the same folder.

Change-Id: I0b2205e1e894bccae3527a6544a9c370b13ffcec
2021-03-06 19:01:48 +00:00
Vadim Kovalenko d14b4161a0 Avoid using LogEntry::getPerformer in favor of getPerformerIdentity
Bug: T274329
Needed-By: I1921ba8586e2d56a9669803532ade5ee2c4c3b56
Change-Id: Ide485fb8f9a0a22d2d7fc7a3bbbe458f603db393
2021-02-25 14:17:22 +00:00
Vadim Kovalenko 3a9fccd270 Avoid using LogEntry::getPerformer in favor of getPerformerIdentity
Bug: T274329
Depends-On: I3dadb20f076494f7b46f0647ea3a8bfbbdaa59da
Change-Id: I30decf50ff20052540dd7dafa2d1077c90aa2a63
2021-02-19 07:54:45 -05:00
Reedy 6cbddccd6b Use updated CheckUser Hooks class
Depends-On: I3f66b660f9d59c0e88b182c9b06ee8cec994348e
Change-Id: I9ba257b9795d1860eff27a7a68a16524deaae6d9
2021-02-11 19:31:13 +00:00
James D. Forrester bd6f715c0c Use User->isRegistered(), not deprecated isLoggedIn()
Bug: T270450
Change-Id: Id90c56ca5cd1439d41b48e49de2b44c3adb69e4d
2020-12-17 18:24:11 -08:00
libraryupgrader cb63494eed build: Updating mediawiki/mediawiki-codesniffer to 33.0.0
Additional changes:
* Dropped .inc files from .phpcs.xml (T200956).

Change-Id: Ie0082065db3abe1f740a0b983ece371ea2d3cfd0
2020-11-04 14:30:29 +00:00
Taavi Väänänen d46356dd73 Allow restricting log entry thanking to subtypes
This commit adds the technical possibility to restrict ThanksLogTypeWhitelist
to only log subtypes like 'rights/rights' in addition to log types like
'rights'.

Bug: T191599
Change-Id: I31fb591dda2e5ecbfb5ac07352d3356134533540
2020-08-21 12:01:24 +00:00
DannyS712 83fb704391 ApiThank: Send thanks logs to CheckUser when extension is enabled
Bug: T252226
Change-Id: Ifff1ca8071e0df161f7f212303469498340dd625
2020-07-03 05:03:28 +00:00
DannyS712 4d18a1e093 BeforeSpecialMobileDiffDisplay hook: Only accept RevisionRecord
Compatibility was added so that MobileFrontend could switch from
Revision to RevisionRecord, but now that the switch has occurred no
need to keep checking to see if a Revision is being passed

See [1] for the MobileFrontend change that required compatibility

[1] e42c52527b

Bug: T246284
Change-Id: Ie320454a0e90d7f98004a3b776010aff784bbf4d
2020-06-30 08:31:50 +00:00
DannyS712 317e0a6810 Hooks: Update to use DifferenceEngineViewHeader
Bug: T255769
Change-Id: I9b8f0359c3478fe1c028b47756d88062c2abcec8
2020-06-24 00:42:58 +00:00
DannyS712 1826d8984d Use new HistoryTools and DiffTools hooks
Extension requires 1.35+, so the hooks are available

Bug: T255494
Bug: T255495
Change-Id: I334928ebd081d53a7d95466e6c4b75715b941ec4
Depends-On: Ib2ab2e26a95affdd1dfa6b945f752157580ea2d3
2020-06-16 00:40:57 +00:00
Umherirrender e1cd44f28d build: Bump phan to 0.10.2, remove taint-check
Declare a variable which is not set in all branches for static code
analyzer, but at runtime it is

Change-Id: I851bdbf9dc092d5213d74a03427b783f61e8946a
2020-05-31 17:05:43 +02:00
DannyS712 0917ab16cc Reduce use of Revision objects in ThanksHooks
Can't remove entirely, since the hooks don't have replacements yet,
but can prepare for the switch while waiting and remove use of
Revision objects to the extent possible

Bug: T251073
Bug: T251593
Change-Id: I5f9e41d58c8d1693b23c84bbfe085d3b33ad0c75
2020-05-27 23:06:13 +00:00
James D. Forrester 84448301ef Use QUnitTestModule instead of deprecated ResourceLoaderTestModules
CI already ensures that MobileFrontend is loaded alongside Thanks, so
the defensive check in the code isn't needed; ext.thanks.mobilediff is
defined statically, it's just injected into the page dynamically in the
onBeforeSpecialMobileDiffDisplay hook handler.

Bug: T232875
Change-Id: I5612a9be65f4d4adf4912645856540dbb04d2b34
2020-05-11 19:43:17 +00:00
Reedy 7768edc7ec Update to use Flow\Notifications\FlowPresentationModel
Change-Id: I419af406f86c495d1448d2be07f8e891bdd7e47a
Depends-On: I25c65cbbc6d43dae7b2515a7b93f02b7180ba89f
2020-04-18 00:19:57 +00:00
DannyS712 859f6a4b57 BeforeSpecialMobileDiffDisplay hook: Prepare to accept RevisionRecord
So that MobileFrontend can pass Revision objects without breaking

Bug: T246284
Change-Id: I2adb63bac52bd721ebffd06082f9c553f50d5cd8
2020-04-15 04:48:50 +00:00
ArtBaltai b6b2c3dfdb Replace usage of deprecated Page in favor of WikiPage/Article
change comment for Page argument

Bug: T239975
Change-Id: If3243d59b129360e1790c68ea193de27d1943462
2020-02-21 08:49:12 +00:00
libraryupgrader a54db3f84e build: Updating composer dependencies
* jakub-onderka/php-console-highlighter: 0.3.2 → 0.4.0
* mediawiki/minus-x: 0.3.2 → 1.0.0
* mediawiki/mediawiki-phan-config: 0.9.0 → 0.9.1

Change-Id: If99754eddc6ba783278142fdd880e39211dd60af
2020-01-31 12:20:18 +00:00
jenkins-bot 388b63445d Merge "build: Updating mediawiki/mediawiki-phan-config to 0.9.0" 2020-01-02 09:04:54 +00:00
Fomafix 5e6f6d8d0f Use $this->getConfig() instead of global variable
Change-Id: Id368f934087b97d33d6404ceed5099034973509a
2019-12-28 21:37:59 +01:00
Fomafix 1a4d901caa Remove bad tab in source code
Change-Id: I868b36dadb2ad0166e94277eda9993fe38cfec37
2019-12-28 20:55:52 +01:00
libraryupgrader 5e473e662d build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Additional changes:
* Added .eslintcache to .gitignore.

Change-Id: I6b7b79e697d7555bb1316fa3d4f821f7a81e02e4
2019-12-28 17:12:46 +00:00
DannyS712 9f495fcedb Don't allow thanking system users
Bug: T237356
Change-Id: I3d7968276a59a66ed4d1931b03310e571d070167
Depends-On: I73f25a10df2c28a69f612eb1db3e91b7125383d9
2019-11-05 22:50:12 +00:00
Umherirrender b8e317d9fb build: Updating mediawiki/mediawiki-phan-config to 0.8.0
Bug: T235049
Depends-On: I381718e52f8764544adec011ca8ca7dde6b489a4
Change-Id: Ia7e7b34b5d263317215d6d35530fe48acec9c858
2019-11-05 18:46:52 +01:00
Derick Alangi 1acb40ee42 Avoid using deprecated Revision class constants, use RevisionRecord
Change-Id: I1932a66c5e6d815680d79770116111266c9db9e3
2019-10-21 15:12:06 +01:00
David Barratt c773e01787 Read the block status from the replicas for the 'thank' link
User::isBlocked() by default reads from the replicas;
PermissionManager::isBlockedFrom() reads from master by default. The
'thank' link is not critical so it should be read from the replicas.

Bug: T231617
Change-Id: I262ed63df82e97862a8dfc8da49fc09465ac8507
2019-08-30 13:28:59 +01:00
Matěj Suchánek 2c94ba17ed Replace $wgUser
Bug: T159299
Change-Id: I023c46a99b96ae9141ac75830c03979e90263ae0
2019-08-27 14:20:39 +02:00
jenkins-bot e044574c08 Merge "Improve EchoCoreThanksPresentationModel" 2019-08-06 23:14:51 +00:00
Matěj Suchánek 8a05d03f67 Improve EchoCoreThanksPresentationModel
Call EchoEvent::getRevision to use cache.

Don't hide notification about thanks for log
when just the comment was hidden.

Also simplify code using ternary ?:

Change-Id: I279291727ecd404db18dd68699744284e17a27ef
2019-08-06 10:28:15 +02:00
Martin Urbanec 003172c157 SECURITY: Do not let users thank for a log entry if actor was deleted
This prevents users from accessing information about the actor
by abusing uselang=qqx and the thank button.

Bug: T224240
Change-Id: I3f42d56874776cfa0c9d364217f43253efc14782
2019-07-11 15:39:16 -07:00