Page MenuHomePhabricator

Long page warning is shown for all pages regardless of size
Open, Needs TriagePublic

Description

If MediaWiki:Longpage-hint is not empty/disabled, then the warning will be shown when editing any page unconditionally.

https://www.mediawiki.org/w/index.php?title=Project:Sandbox&action=edit gives warning that the page is too long because it's '79 bytes' long.

The message on mw.org was recently created that's why the warning is showing now. But even if the message is created there's no point in showing it for pages that are considerably a long way of reaching even the default $wgMaxArticleSize)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptThu, Jan 14, 12:36 PM
Pppery added a subscriber: Pppery.Thu, Jan 14, 3:47 PM

The message on mw.org was recently created that's why the warning is showing now. But even if the message is created there's no point in showing it for pages that are considerably a long way of reaching even the default $wgMaxArticleSize)

Hmm, yeah, my intent was to show it for articles above 32KiB, the previous behaviour. Looking at the history of the code, it seems to be broken in this manner since it was de-defaulted in rMW0b92d62616b4: (bug 21911) Per Tim Starling's comment #10: Remove hard coded limit for long….

(Also the warning should be a page notice so that it's picked up by VE and other API editors.)

For now, I've changed it to use a parser function to hide it, but that's not very efficient.

From my understanding of that message it was just an entry point for every page which gets the current size (or the new size on preview or the size of a section on section edit) as formatted and raw number and than the local community can choose what to do.

The hint for long pages was useful on older browser which often crashed on big textarea or on small network.

It is used on dewiki since 2011 without problems - https://de.wikipedia.org/w/index.php?title=MediaWiki:Longpage-hint&action=edit

For now, I've changed it to use a parser function to hide it, but that's not very efficient.


The message is hidden, but I am seeing this now. Is this a ParserFunctions bug or something else?

When looking on the mediawiki page it looks broken, because the parameter are not replaced. But when the message is parsed in context of editpage the parameter are there and the message is valid. To verify it, you need a page above 32000 bytes.

Take one from https://www.mediawiki.org/w/api.php?action=query&list=allpages&apminsize=32000 and open edit form with the "old editor"

Yes, I see it works, expression is being correctly evaluated. I am talking about the error message visible on the source page.

The wikitext is

#ifexpr: $2 >= 32000

but $2 is only given when parsed and that breaks on view of the source page. That is normal for messages and not a parser function bug.

matmarex closed this task as Declined.Tue, Jan 19, 9:48 PM
matmarex added a subscriber: matmarex.

Looks like it has always been this way. No reason to change it.

Ammarpad reopened this task as Open.EditedWed, Jan 20, 4:19 AM

I don't think so. In stock MediaWiki, if you create the message, it will be shown for all pages and this behavior cannot be stopped unless the message is deleted, that does not look OK. The Parser Functions used by Jforrester to "hide it" are not part of MediaWiki core, and it is buggy itself. We shouldn't rely on extension to correct this clearly undesired behavior in core.

There should be a clearly-defined or configurable condition that will trigger showing the message (just as it was before it was removed without replacement). It's better to have the old hardcoded limit than this unconditional unwanted behavior.