Last modified: 2010-05-15 16:03:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 14094 - When the expansion size is reached, the editor is not warned about it
When the expansion size is reached, the editor is not warned about it
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Nicolas Dumazet
: patch, patch-need-review
Depends on:
  Show dependency treegraph
Reported: 2008-05-12 15:55 UTC by Nicolas Dumazet
Modified: 2010-05-15 16:03 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

proposed patch (7.22 KB, patch)
2008-05-12 15:55 UTC, Nicolas Dumazet

Description Nicolas Dumazet 2008-05-12 15:55:22 UTC
Created attachment 4896 [details]
proposed patch

An editor previewing a page using too many parser functions is warned "Warning: This page contains too many expensive parser function calls", and the page is put in a maintenance category.

This is not the case when you include too many templates in a page/use too long template arguments. Of course, one can dig into the HTML source, but that is not really user-friendly.

This patch tries to handle that issue, adding two more warning messages, and two more maintenance categories.

I'd like some more experienced users to review it so that I can commit it :)
Comment 1 Brion Vibber 2008-05-19 20:45:28 UTC
Perhaps change getWarnings() to encapsulate that array_keys() call?

The check for addWarning() existence probably got moved over from when this lived in ParserFunctions, so couldn't be sure what version parser was present; it ought to be safe to remove that check now.

On this:
+			if ( is_null( $current ) || is_null( $max ) ) {
+				$warning = wfMsg( $msgName );
+			} else {
+				$warning = wfMsg( $msgName, $current, $max);
+			} 

it should be quite safe to just pass them on; they'll do no harm if present but unused.
Comment 2 Nicolas Dumazet 2008-05-19 21:34:56 UTC
Thanks for the review :)

Committed, with your changes, in r35059

Note You need to log in before you can comment on or make changes to this bug.