mw.widgets.TitleWidget.prototype.getTitle conflicts with OO.ui.mixin.TitledElement.prototype.getTitle
Closed, ResolvedPublic

Description

In the context of mw.widgets.TitleInputWidget#setTitle(), mw.widgets.TitleWidget.prototype.getTitle() is used instead of OO.ui.mixin.TitledElement.prototype.getTitle() and that produces a wrong value for the HTML title attribute.

SBisson created this task.Jan 4 2018, 1:54 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 4 2018, 1:54 PM

Change 402073 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[oojs/ui@master] Ensure TitledElement mixin uses the right getTitle() function

https://gerrit.wikimedia.org/r/402073

TitleWidget should be the one that adjusts here, in my opinion, since 'title' in this case is for HTML properties, rather than having the mixin allow for things it wasn't designed for.

The TitleWidget is mixing two concepts -- title as in Mediawiki Title object, and title as in the HTML property (which is what the mixin if for). I agree with the mixin internally using this.title instead of this.getTitle() but honestly, the TitleWidget -- since it's using TitledElement, should know better, and use a different definition of the MW Title or it should call it something else, OR it should not use TitledElement.

The term "title" having 2 different meanings is the problem here; I don't think the solution is necessarily changing the mixin.

(Sidepoint that I also wrote in the patch -- if we do remove the method, we must deprecate it first, since it's heavily used everywhere else)

Change 402073 abandoned by Sbisson:
Ensure TitledElement mixin uses the right title

https://gerrit.wikimedia.org/r/402073

Change 402112 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[mediawiki/core@master] Rename TitleWidget#getTitle so it won't clash with TitledElement#getTitle

https://gerrit.wikimedia.org/r/402112

Volker_E moved this task from Backlog to Doing on the OOUI board.Jan 6 2018, 7:28 AM

Change 402112 merged by jenkins-bot:
[mediawiki/core@master] [BREAKING CHANGE] Rename TitleWidget#getTitle to TitleWidget#getMWTitle

https://gerrit.wikimedia.org/r/402112

Checked in betalabs - the tooltip displays the white spaces in page titles correctly.

Etonkovidova closed this task as Resolved.Jan 11 2018, 10:41 PM