Commit graph

8 commits

Author SHA1 Message Date
libraryupgrader
5357695270 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs now pass and were enabled:
  * Generic.ControlStructures.InlineControlStructure
  * MediaWiki.PHPUnit.AssertCount.NotUsed

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)

Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
2021-07-22 03:36:05 +00:00
James D. Forrester
df5eb22f83 Replace uses of DB_MASTER with DB_PRIMARY
Just an auto-replace from codesniffer for now.

Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
2021-04-29 09:24:31 -07:00
jenkins-bot
37ab31298c Merge "Remove $actor field from UsererIdentityValue" 2021-04-14 14:40:12 +00:00
daniel
fed7f0b179 Remove $actor field from UsererIdentityValue
Code that needs to store an actor ID in the database to
represent a UserIdentity, or needs to construct a UserIdentity based on
an actor ID loaded from the database, should use the ActorNormalization
service.

Note: The getActorId() method is removed from the UserIdentity interface,
but all concrete classes continue to support it for now.
UsererIdentityValue::getActorId() is hard deprecated and should
be removed in 1.37. It always returns 0.
User::getActorId() is not deprecated at this point.

Bug: T274179
Depends-On: Id2b3ddf6a2a7cdf90f8936a69148d2cce6fde237
Change-Id: I9925906d11e47efaec3c1f48d5cb3f9896a982c1
2021-04-13 18:18:06 +00:00
Petr Pchelko
9e0c6afaae Support User:0 in ActorStore
Surprizingly, PHP treats string "0" as false, so user name "0"
was unconditionally rejected by ActorStore. Even more surprizingly,
we actually have an actor with user name "0" [1], so we need to
explicitly check for nulls instead of just checking for falsy.

[1] https://en.wikipedia.org/wiki/User:0

Change-Id: I535c2aee3e109c3f535e40b747a1c7e4508171cb
2021-04-06 19:49:53 -06:00
Vadim Kovalenko
493105109e Avoid using UserIdentity::getUserId
Replace UserIdentity::getUserId with ::getId
Add $wikiId = self::LOCAL as an optinal parameter to User and
UserIdentity

Bug: T275482
Change-Id: I44494845c469a14284c3e23cb620e5a7cbf59cd5
2021-03-02 16:12:55 -07:00
daniel
0ebf43b26d ActorStore: introduce findActorIdByName
The findActorIdByName method is intended to be used when we need to
select by actor ID, but all we have is a user name. We can't use
findActorId(), since it requires a UserIdentity, which would needlessly
force us to look up a user ID, resulting in two queries.

Bug: T274179
Change-Id: I0e65d3258fd3d23ebff793ae04d59e027eb51fba
2021-03-01 22:12:05 +01:00
Petr Pchelko
87a5cb4673 UserQueryBuilder: abstraction for actor table queries.
This introduces a specialized SelectQueryBuilder for
queries related to actor table. So far it's fairly basic,
but in future it is intended to grow.

This patch only introduces the new abstraction, using
it will be separated into separate patches.

Bug: T274223
Change-Id: Ibb1c58016e3956a46bfaf1a9f51f265114bb9ace
2021-02-22 11:47:07 -07:00