Page MenuHomePhabricator

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


@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

D3r1ck01 created this task.Aug 27 2019, 9:36 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 27 2019, 9:36 PM
D3r1ck01 updated the task description. (Show Details)Aug 28 2019, 9:29 PM
D3r1ck01 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.