Page MenuHomePhabricator

[Needs investigation] What's the way forward with setMainPage() in MobileFormatter.php?
Closed, ResolvedPublic

Description

@Jdlrobson, in 7d02b5ac84, you deprecated setMainPage() method that it will be removed in the future. I'm opening this because usage of this method in MF is quite a lot and in tests as well. What is the future of it, I'm happy to work on it if you guide me :)

Related task: T176414. @pmiazga, maybe you have ideas too, please chime in :)

Piece of code:

/**
 * Change mainPage (is this the main page) to $value (standard: true)
 * This enables special casing for the main page.
 * @deprecated
 * @param bool $value
 */
public function setIsMainPage( $value = true ) {
    $this->mainPage = $value;
}

Event Timeline

xSavitar updated the task description. (Show Details)
Jdlrobson triaged this task as Medium priority.Sep 5 2019, 8:07 PM
Jdlrobson moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.

I think this is deprecated because of T32405. It's needed as long as we have the MainPage formatting (LegacyMainPageTransform). What problems are you hitting?
I think it's acceptable to drop the method and use $config->get( 'MFSpecialCaseMainPage' ) && $title->isMainPage() directly.

@D3r1ck01 I think the way forward is to deprecate this method and remove it from the codebase when T32405 is finally resolved.

Does that answer satisfy the goals of this ticket?
Do you want to raise a patch to mark it as deprecated?

@D3r1ck01 I think the way forward is to deprecate this method and remove it from the codebase when T32405 is finally resolved.

Yeah, sounds like a great approach!

Does that answer satisfy the goals of this ticket?

Yes, I think so.

Do you want to raise a patch to mark it as deprecated?

No problem. Will submit shortly!

Sounds good. Shall we close this task out or should I leave it open for that patch?

We've reached a consensus, you can close the task @Jdlrobson. I'll cleanup several usage of the method then hard-deprecate it after that. :)

Jdlrobson claimed this task.

Thanks @D3r1ck01 !