Page MenuHomePhabricator

Add id attribute to error message "mw-error-cannotundelete"
Closed, ResolvedPublic

Description

Error messages should be wrapped in a container which allows it to style or modify them with CSS and/or JavaScript. Currently, some error messages aren't wrapped in such. Your task is to add a css class, like mw-error-cannotundelete, to the usage of the cannotundelete interface message.

Related Objects

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:39 PM
bzimport set Reference to bz18819.
bzimport added a subscriber: Unknown Object (MLST).

rahul14m93 wrote:

Can you shed a little more light on the problem espcially where to find these error messages?Thank you

(In reply to comment #1)

Can you shed a little more light on the problem espcially where to find these
error messages?

Where to find them in the code or what else? Platonides already said the names of some of them, e.g. [[MediaWiki:Missing-article]].

So this task is basically about wrapping an error message into a class, similar to $outputPage->wrapWikiMsg( "<div class=\"error mw-error-cannotdelete\">\n$1\n</div>" in /includes/page/Article.php or $wgOut->wrapWikiMsg( "<div class='error' id='mw-edit-longpageerror'>\n$1\n</div>", in ./includes/EditPage.php ?

That includes: cannotdelete, cannotundelete, missing-article...

How would a potential patch contributor find the places to fix?

For example, running grep -r "cannotundelete" . I get:

./maintenance/dictionary/mediawiki.dic:cannotundelete
./includes/api/ApiUndelete.php:			$this->dieUsageMsg( 'cannotundelete' );
./includes/api/ApiBase.php:		'cannotundelete' => [
./includes/specials/SpecialUndelete.php:					'cannotundelete',
./includes/specials/SpecialUndelete.php:					'cannotundelete'

so I guess I would have to patch includes/specials/SpecialUndelete.php in that case?

And for missing-article I cannot find anything (except for translations). Could someone clarify?

Florian added a project: Google-Code-In-2016.
Florian subscribed.

Ok, cannotdelete has already a wrapping container with a class:
https://github.com/wikimedia/mediawiki/blob/f7ae4d41b8675d714edf502288fd5308ad1e53db/includes/page/Article.php#L1558-L1560

As missing-article seems to isn't used in MediaWIki/core (anymore), we should first think about this message, before changing anything :P So, this task is easy and easy enough for GCI! :D

To better understand the scope here, this is only about wrapping mw-error-cannotundelete?
Or are patch contributors expected to find more such cases themselves (how)?

No, let's do just the one for now! :)

Aklapper renamed this task from Add id attribute to error messages to Add id attribute to error message "mw-error-cannotundelete".Dec 18 2016, 9:08 AM

Change 328943 had a related patch set uploaded (by Divadsn):
Add id attribute to error message "mw-error-cannotundelete"

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

Change 328943 merged by jenkins-bot:
Add id attribute to error message "mw-error-cannotundelete"

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

MtDu subscribed.

Patch has been merged. Hence closing as resolved.