Page MenuHomePhabricator

Make User::getUserPage and User::getTalkPage return a LinkTarget
Open, LowPublic

Description

User::getUserPage and User::getTalkPage are intended for linking to user pages, so a LinkTarget target should be sufficient. Not returning a full Title object would help with resolving the circular dependency between Title and User.

Event Timeline

daniel removed daniel as the assignee of this task.Jun 1 2020, 1:35 PM

@daniel are you still working on this?

Not tight now, no

Pchelolo subscribed.

These 2 methods are the last dependency from User to Title!

Instead of changing the method return type I propose to simply deprecate them in favor of PageReferenceValue::localReference( NS_USER/NS_USER_TALK, $user->getName() ) - works with UserIdentity too!

These 2 methods are the last dependency from User to Title!

Wow, nice!

Instead of changing the method return type I propose to simply deprecate them in favor of PageReferenceValue::localReference( NS_USER/NS_USER_TALK, $user->getName() ) - works with UserIdentity too!

Having a convenience method somewhere would be nice though... Also, proper modeling the concept of a "user page" could be helpful. Maybe introduce a UserPageLookup service? That would make it easy to introduce more elaborate modeling later. This is especially relevant for anonymous users - we may want do add special treatment for them at some point, instead of having "IP user pages" (or, with IP masking, "random string user pages").

Maybe introduce a UserPageLookup service?

I've started something like it in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/673298 but we were never sure we actually wanted it..

Daimona renamed this task from Make User::getPage and User::getTalkPage return a LinkTarget to Make User::getUserPage and User::getTalkPage return a LinkTarget.Feb 12 2022, 3:14 PM
Daimona updated the task description. (Show Details)