Page MenuHomePhabricator

parse.php: Initialize PageConfig properties based on title (-pageName arg OR default)
Closed, ResolvedPublic


See discussion @

If you look at the code for src/Config/Api/PageConfig.php for the case where $opts['pageContent'] is passed in, it falls back to 'en' and 'ltr' page properties. However, it should actually be initializing these properties based on the title much like how we do it for the API when we post content against a title and where page properties come from the title object.

Check whether the code paths from parse.php -> MockPageConfig/MWPageConfig also need similar fixes.

Also, note that in Parsoid/PHP, PageConfig::getPageLanguage() and PageConfig::getPageLanguageDir() don't return null values => all conditionals in the codebase around these return values should be eliminated since we are going to be initializing these values correct always after the fixes above.

Event Timeline

ssastry triaged this task as Medium priority.Oct 24 2019, 8:29 PM
ssastry created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 24 2019, 8:29 PM

Change 545391 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Add language converter endpoints to the REST API

Change 545391 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Add language converter endpoints to the REST API

Arlolra closed this task as Resolved.Oct 27 2019, 9:20 PM
Arlolra claimed this task.