I would appreciate some discussion and feedback on a change that I have proposed to MediaWiki core [0,1].
The DISPLAYTITLE magic word allows alternate text to be displayed for the title of a page [2]. The SemanticTitle extension builds upon this capability enabling alternate mechanisms to set the display title [3]. The display title functionality in MediaWiki core is currently implemented using the page_props table [4]. I recently proposed a MediaWiki core change to a) encapsulate access to the page_props table in a class and b) extend the usage of a page’s displaytitle property so that it is also used as the link text for links to the page. That latter point is functionality currently in the SemanticTitle extension that would be re-implemented in core and removed from SemanticTitle. Two questions regarding the proposed patch were raised about which I would appreciate additional discussion.
The first question is whether the display title functionality should be re-implemented as a part of the Article or WikiPage class. I support that suggestion, but before pursuing that path would like additional input, because it would require a larger change to core, including a database modification. One of the advantages of this approach would be that the display title could be updated in the database immediately when a page is saved; in the current approach, the update to the page_props table is deferred, causing a lag between when the user makes the change and when links relying upon this information would be updated accordingly.
The second question is whether querying for the display title while creating page links would impose a performance penalty. While we have not seen a penalty in our environment, perhaps there are environments in which this would have a greater cost. Would this cost be significant? It is possible that changing the implementation to being part of the Article or WikiPage class could alleviate some of this penalty, since the display title information could be retrieved when other information for the page is accessed from the database.
I would appreciate additional input on these changes to help decide upon next steps. Thank you!
Cindy (https://www.mediawiki.org/wiki/User:Cindy.cicalese)
[0] https://phabricator.wikimedia.org/T115331
[1] https://gerrit.wikimedia.org/r/#/c/246246/
[2] https://www.mediawiki.org/wiki/Manual:$wgAllowDisplayTitle
On Fri, Oct 23, 2015 at 8:19 AM, Cindy Cicalese cindom@gmail.com wrote:
I recently proposed a MediaWiki core change to a) encapsulate access to the page_props table in a class and b) extend the usage of a page’s displaytitle property so that it is also used as the link text for links to the page.
Part b) feels like a Request For Comment because as I understand it this will change the way links behave. You should write a phabricator ticket for b) and add the #MediaWiki-RfCs tag to it [1]. As for a), it seems your gerrit patch is well along and I'm not sure adding one class rises to the level of an architectural change that would prompt an RFC.
[1] https://www.mediawiki.org/wiki/Requests_for_comment/Process
Cheers,
wikitech-l@lists.wikimedia.org