Page MenuHomePhabricator

CSS for errors turns the whole message to red
Closed, ResolvedPublic

Description

Today on it.wiki I tripped a filter for obsolete tags which I created myself. With big surprise, I noticed that the warning message is wrapped inside an errorbox div, which causes the whole message to turn to red. To be precise, this is how the warning should look like and this is how it actually appears.

Filter_warning.png (974×1 px, 136 KB)

Is this a wanted behaviour? Maybe we should consider leaving the red background but removing (or colouring separately) the "Error:" writing, since this is actually quite hard to read.

Event Timeline

Daimona triaged this task as Medium priority.Feb 12 2018, 1:58 PM
Daimona moved this task from Backlog to Internal bugs on the AbuseFilter board.

This often happens when there is a mistake somewhere in some translated string (e.g. not closing a </div> tag etc).
Hence might not be a software bug.

Are there public steps to reproduce? I don't get any warning when previewing https://it.wikipedia.org/w/index.php?title=Utente:Daimona_Eaytoy/Sandboxtest

I'm not sure about the nature of this behaviour, though the wrapping in that div seems to be intentional and that class does have a color:red attribute.
In order to reproduce this you can simply use a sandbox (feel free to use mine, which I linked) and try to publish an edit which adds any kind of obsolete tag (tt, strike, font or center); the filter will fire that red warning.

Huh, that point in the code isn't actually related to the warning. I was deceived since it's the only time "errorbox" appears in AF code. So there might be a trouble elsewhere.

With a little investigation, I finally found out the cause. AF runs a hook (EditFilterMergedContent) which wraps the warning in an errorbox, thus causing the issue. This was ultimately introduced by T149473 with this commit (although first introduction was this, which was broken). As for a solution, I really don't know. If we want to keep the errorbox (which actually increases visibility), a good solution may be to add to the div an inline style with color set to initial.

EDIT: Also removing the initial "Error:" may be good, since a filter warning isn't an error and it only takes space.

Also adding project and a bunch of main subscribers of the previous task.

Change 416750 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/core@master] Override color for warning errorbox

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

Actually, we may also completely get rid of the errorbox and maybe build a specific abusefilter-error-box. In any case this needs to be discussed.

Change 416750 abandoned by Daimona Eaytoy:
Override color for warning errorbox

Reason:
We need to discuss an alternative solution.

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