"Mediawiki:Excontentauthor" order problem
Closed, ResolvedPublic

Description

The "Mediawiki:Excontentauthor" has a form of

content was: "$1", and the only contributor was "$2" (talk)

But if the $1 length is big enough (for example, 10K page deleting), it is truncated (as should be), and also $2 is truncated (as should not be, creating something like

[[special contribu...]]

We changed in hewiki the order of the message to

the only contributor was "$2" (talk) and content was: "$1"

and it works fine now. But @Amire80 asked me to inform you about this problem. I can't see how it can be fixed, because we can't create a parser for each mediawiki message, but he is the boss, so he knows all :-).

Event Timeline

IKhitron raised the priority of this task from to Needs Triage.
IKhitron updated the task description. (Show Details)
IKhitron added subscribers: IKhitron, Amire80, Kipod.

We can swap the order for all languages rather than just one message locally. And this may also be useful for some other messages.

This is a very good solution. Do we need the phabricator help to change the text of mediawiki message original, @Amire80?

Phabricator is a task management system, and this task is literally one of more than 100,000 tasks, so yes.

I am a newbie. Can u elaborate this bug. such that i will try to fix it.

Ammarpad subscribed.

I don't think we need this, the username is no longer truncated

Based on the code flow here, this problem appears to have already been fixed:

		} else {
			if ( $onlyAuthor ) {
				$reason = wfMessage(
					'excontentauthor',
					'$1',
					$onlyAuthor
				)->inContentLanguage()->text();
			} else {
				$reason = wfMessage( 'excontent', '$1' )->inContentLanguage()->text();
			}
		}
		if ( $reason == '-' ) {
			// Allow these UI messages to be blanked out cleanly
			return '';
		}
		// Max content length = max comment length - length of the comment (excl. $1)
		$maxLength = CommentStore::COMMENT_CHARACTER_LIMIT - ( strlen( $reason ) - 2 );
		$text = $content ? $content->getTextForSummary( $maxLength ) : '';
		if ( $blank && !$text ) {
			// Don't display "content before blanking was ''" as misleading
			// This can happen if the content before blanking was two unclosed square brackets, for example
			// Do display `content was ""` if the page was always blank, though
			return false;
		}
		// Now replace the '$1' placeholder
		$reason = str_replace( '$1', $text, $reason );
		return $reason;
	}

I just tested this on testwiki, and it can be seen to work as expected.

I assume this task can be closed as resolved.

ArielGlenn claimed this task.
ArielGlenn subscribed.

Confirmed that this bug is fixed, so closing.