Page MenuHomePhabricator

Add ability to disable MediaWiki messages
Closed, ResolvedPublic

Description

It would be nice to have a way to disable certain system messages. Currently, if you blank them, they revert to the default, so various hacks are used instead. People insert &nbsp; or <p></p>, but having a consistent way to disable messages would be best. Perhaps use a - like the sitenotice does?


Version: unspecified
Severity: enhancement
See Also:

Details

Reference
bz14176

Event Timeline

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

I'm not sure about "-" since some messages may contain only that char (I saw wiki with that as category separator), however I support this with all ten fingers.

Why do empty messages render the default anyway? If you want the default message, it seems to me that the most intuitive thing to do is to just delete the message page.

(In reply to comment #2)

Why do empty messages render the default anyway?

I don't know, I fixed this once already. It must be a regression.

In MessageCache.php:
708 if ( substr( $entry, 0, 1 ) === ' ' ) {
709 return substr( $entry, 1 );

var_dump( substr( ' ', 1 ) );

bool(false)

Changing it to mb_substr would work, as mb_substr doesn't have this odd behavior of returning false. Can we fix this or do some wikis rely on the current behavior?

-easy: I doubt it is, involving message cache etc.

(In reply to comment #5)

-easy: I doubt it is, involving message cache etc.

This isn't evidence of the bug not being easy. Restoring the keyword. Also, read comment 4.

(In reply to comment #3)

(In reply to comment #2)

Why do empty messages render the default anyway?

I don't know, I fixed this once already. It must be a regression.

Did anyone get a chance to look at why this was reverted/when it regressed?

Related URL: https://gerrit.wikimedia.org/r/64277 (Gerrit Change Id91914a3701fe53f1e2e894824512489392c628b)

(In reply to comment #8)

Related URL: https://gerrit.wikimedia.org/r/64277 (Gerrit Change
Id91914a3701fe53f1e2e894824512489392c628b)

MZMcBride wrote:


I'm concerned that this is a "scap trap" for Wikimedia wikis and possibly needs more emphasis/prominence in the release notes.

As I understand it (and please correct me if I'm mistaken), the old behavior was that when a MediaWiki message existed (as a page in the page table) but was blank, it reverted to the default message. After this proposed changeset, the new behavior will be that when a MediaWiki message exists and is blank, it will be output as blank.

Generally, it's good to correct this behavior. But I'm concerned that editors have relied upon the old behavior and will be surprised when it suddenly changes.

Parent5446 wrote:


@MZMcBride - Actually, the previous behavior was slightly different. What would happen is that on the first request, a blank message would be shown as blank. But then on subsequent requests (after the message was cached), it would return false and fall back to the default.

Nonetheless you have a point. Most likely some people might be relying on this change. Maybe I should add it to the breaking changes section in the release notes?

I'm not sure.

(In reply to comment #9)

I'm concerned that this is a "scap trap" for Wikimedia wikis [...]

Greg G.: copying you due to this.

The jargon for "disable this message" is "-", not "", isn't it? (But it works only on some messages.) Is there any reason why blank is better than hyphen to add ability to disable MediaWiki messages?

(In reply to comment #11)

The jargon for "disable this message" is "-", not "", isn't it? (But it works
only on some messages.) Is there any reason why blank is better than hyphen
to add ability to disable MediaWiki messages?

Comment 1 discusses this. :-)

For the record, the original change to allow messages to be blank without falling back to the default was r10975 (September 2005).

Has this been fixed? The above patch has been merged.

Bug 48956 notwithstanding, this bug is currently fixed (as bug 49793 demonstrates). Updating the bug status accordingly.

(In reply to comment #15)

Bug 48956 notwithstanding, this bug is currently fixed (as bug 49793
demonstrates). Updating the bug status accordingly.

So how does one disable the local message i.e. restore default? Only by deleting?

(In reply to comment #16)

(In reply to comment #15)

Bug 48956 notwithstanding, this bug is currently fixed (as bug 49793
demonstrates). Updating the bug status accordingly.

So how does one disable the local message i.e. restore default? Only by
deleting?

You disable the message by blanking the page. You revert to the default by deleting the page. I think this is logical behavior.