Page MenuHomePhabricator

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


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.



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:

./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?

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptDec 15 2016, 7:22 PM
Florian updated the task description. (Show Details)Dec 16 2016, 10:47 PM
Florian added a project: Google-Code-In-2016.
Florian added a subscriber: Florian.

Ok, cannotdelete has already a wrapping container with a class:

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
divadsn claimed this task.Dec 23 2016, 7:51 PM

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

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

MtDu closed this task as Resolved.Dec 27 2016, 12:22 AM
MtDu added a subscriber: MtDu.

Patch has been merged. Hence closing as resolved.