Page MenuHomePhabricator

[subtask] successbox, errorbox and warningbox classes will no longer function in 1.39 release
Closed, ResolvedPublic

Description

NOTE: Please create subtasks to manage works by your team. Your assistance is greatly appreciated.

These classes conflict with on wiki styles so will be replaced with new classes.
This impacts any code which is declaring the old class.

We need to update various instances of https://codesearch.wmcloud.org/deployed/?q=%5B%27%22%20%5C.%5D(error%7Csuccess%7Cwarning%7Cmessage)box%5B%5E%5C.%5D&i=nope&files=&excludeFiles=(stories%2F.*%7Ctest%2Ffixtures%2F*%7Cwmf-config%2FCommonSettings.php%7Cresources%2Fext.nearby.scripts%2FErrorbox.vue%7Ctests%2Fcases%2F.*%7Ci18n%2F%5B%5Ee%5D.*json%7Chandlebars%2Fcompiled%7Ctests%2Fjest%2FApp.test.js)&repos=
To avoid breakage

Before:

Html::rawElement( 'div',
	[ 'class' => 'warningbox' ],
	$ctx->msg( 'confirmedit-preview-description' )->parse()
)

After:

Html::warningBox(
	$ctx->msg( 'confirmedit-preview-description' )->parse()
)
  • In JavaScript, there is currently no API. You will need to hardcode the classes for now to use mw-message-box and mw-message-box-(warning|success|error) (see https://gerrit.wikimedia.org/r/c/mediawiki/core/+/757765 for more context on why there is currently no JavaScript API)
  • Update any Output::wrapWikiMsg methods

Before:

$out->wrapWikiMsg( "<div class='errorbox'>\n$1\n</div>\n",
	[ 'missing-revision', $this->oldid ]
);

After:

use Html;

		$out->addHTML(
			Html::errorBox(
				$out->msg( 'missing-revision', $this->oldid )->parse()
			)
		);

Before:

$this->getOutput()->wrapWikiTextAsInterface(
	'errorbox',
	$wikitext
);

After:

$out = $this->getOutput();
$out->addHTML( Html::errorBox( $out->parseAsContent( $wikitext ) ) );

Related Objects

StatusSubtypeAssignedTask
Resolvedovasileva
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedStang
ResolvedStang
OpenNone
OpenNone
OpenNone
ResolvedWMDE-Fisch
ResolvedWMDE-Fisch
ResolvedSgs
ResolvedWMDE-Fisch
ResolvedLucas_Werkmeister_WMDE
ResolvedJdlrobson
ResolvedStang
Resolvedmatmarex
ResolvedSimoneThisDot
ResolvedEtonkovidova
ResolvedStang
ResolvedJdlrobson
ResolvedStang
ResolvedTacsipacsi
ResolvedSamwalton9
ResolvedSamwalton9
ResolvedJdlrobson
Resolvedabi_
DeclinedNone
ResolvedStang
ResolvedStang
ResolvedTacsipacsi
ResolvedTacsipacsi
OpenNone
ResolvedTacsipacsi
ResolvedSamwalton9
ResolvedSgs

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 770584 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Hide success box on mobile options page

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

Quoting from the task description:

In JavaScript, extensions should use the new mw.util.messageBox function (see https://gerrit.wikimedia.org/r/c/mediawiki/core/+/757765)

Reviewing the comments on the patch, I think it was decided to use the classes directly. They are: mw-message-box-error, mw-message-box-notice, mw-message-box-warning, mw-message-box-success.

Additionally the class: mw-message-box should always be added.

If this is correct, can we update the patch description?

Quoting from the task description:
If this is correct, can we update the patch description?

That's correct, thanks for pointing out!

Change 773365 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/CiteThisPage@master] CiteThisPage should use Html:errorBox

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

Change 773365 merged by jenkins-bot:

[mediawiki/extensions/CiteThisPage@master] CiteThisPage should use Html:errorBox

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

Tacsipacsi changed the status of subtask T304602: Fix use of errorbox in Gadgets from Open to In Progress.

The only result for (error|warning|success|message)box in MediaWiki-extensions-SecureLinkFixer is rESLF domains.php:107052 (at 8dc17b5cfbb4), an unrelated domain name. All Gerrit changes directly linked to this task have been merged (and I hope future ones will be linked to subtasks to make handling tasks statuses and assignees easier to handle).

Jdlrobson claimed this task.

Closing subtask since most of the work is now done, and where it isn't subtasks have been opened.