Last modified: 2014-09-02 06:04:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T61075, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59075 - {{DISPLAYTITLE:}} not taken into account when opening a page for editing (but okay during previewing)
{{DISPLAYTITLE:}} not taken into account when opening a page for editing (but...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.23.0
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-28 14:22 UTC by Bartosz Dziewoński
Modified: 2014-09-02 06:04 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bartosz Dziewoński 2013-12-28 14:22:41 UTC
DISPLAYTITLE is not taken into account when first opening the page for editing, but it applied on previews.

The culprit seems to be these two pieces of code in EditPage:

    # need to parse the preview early so that we know which templates are used,
    # otherwise users with "show preview after edit box" will get a blank list
    # we parse this near the beginning so that setHeaders can do the title
    # setting work instead of leaving it in getPreviewText
    $previewOutput = '';
    if ( $this->formtype == 'preview' ) {
      $previewOutput = $this->getPreviewText();
    }

…

    # Use the title defined by DISPLAYTITLE magic word when present
    $displayTitle = isset( $this->mParserOutput ) ? $this->mParserOutput->getDisplayTitle() : false;
    if ( $displayTitle === false ) {
      $displayTitle = $contextTitle->getPrefixedText();
    }
    $wgOut->setPageTitle( wfMessage( $msg, $displayTitle ) );


getPreviewText(), among other things, sets mParserOutput. It doesn't seem to be set by any other code paths, so later $displayTitle === false and the page title is used.

We could add an 'else' and set mParserOutput to something these (but frankly, given how complex this stuff is, I have no idea how to get a "right" ParserOutput here), or just run getPreviewText() unconditionally (which might result in unnecessary parses and whatnot…).
Comment 1 Brad Jorsch 2013-12-28 19:35:25 UTC
I'm inclined to say this isn't actually a bug. We don't honor DISPLAYTITLE on history or diff pages either, or action=info. Why should we on the non-preview edit form? On the other hand, we *should* honor it on preview because there you probably want to preview the effects of the DISPLAYTITLE along with everything else.
Comment 2 Bartosz Dziewoński 2013-12-28 20:01:00 UTC
(In reply to comment #1)
> We don't honor DISPLAYTITLE on
> history or diff pages either, or action=info.

Hmm, I guess that's true. I'd call this a bug too (or a lack of
an enhancement ;) ).


Changing the title on preview only sounds like a silly thing to do,
but I guess I won't be hurt or anything if this is WONTFIXed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links