Web browser: ---
            Bug ID: 59075
           Summary: {{DISPLAYTITLE:}} not taken into account when opening
                    a page for editing (but okay during previewing)
           Product: MediaWiki
           Version: 1.23-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Page editing
    Classification: Unclassified
   Mobile Platform: ---

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…).

You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
Wikibugs-l mailing list

Reply via email to