Page MenuHomePhabricator

Special:NewPages - add <span> for "originally created as..."
Closed, ResolvedPublic

Description

This is more a feature request, than a bug.

When listing new pages with Special:NewPages and you moved a page, there will be written "originally created as <pagename>".
Unfortunately, this is plain text and no html-element. So there is no change to format this text with css. Or - in my case - hide it.

Is there a chance, to enclose this message with a <span>?

Using MW 1.27.1

Event Timeline

Steps to reproduce:

  • Create a page Test
  • Move page to Template:Test

Then you'll see

originally created as "Test"

after the last <span> when calling Special:NewPages

Reedy subscribed.

rc-old-title is the message used

		# Display the old title if the namespace/title has been changed
		$oldTitleText = '';
		$oldTitle = Title::makeTitle( $result->rc_namespace, $result->rc_title );

		if ( !$title->equals( $oldTitle ) ) {
			$oldTitleText = $oldTitle->getPrefixedText();
			$oldTitleText = $this->msg( 'rc-old-title' )->params( $oldTitleText )->escaped();
		}

		return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} "
			. "{$dm}{$ulink} {$comment} {$tagDisplay} {$oldTitleText}</li>\n";

https://github.com/wikimedia/mediawiki/blob/master/includes/specials/SpecialNewpages.php#L373-L383

So changing

$oldTitleText = $this->msg( 'rc-old-title' )->params( $oldTitleText )->escaped();

to

$oldTitleText = Html::rawElement( 'span', [ 'class' => 'mw-newpages-oldtitle' ],
$this->msg( 'rc-old-title' )->rawParams( $oldTitleText )->escaped() );

would be a valid solution?

Sidhant-gupta-004 subscribed.

Hello,
I am new to WikiMedia and have picked this problem in order to learn how to create and submit patches here. Any suggestions, and/or help you could offer me is welcome. :)

Change 313762 had a related patch set uploaded (by Sidhant-gupta-004):
Special:NewPages - add <span> for "originally created as..."

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

Change 313762 merged by jenkins-bot:
Special:NewPages - add <span> for "originally created as..."

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

Reedy assigned this task to Sidhant-gupta-004.