Page MenuHomePhabricator

When the expansion size is reached, the editor is not warned about it
Closed, ResolvedPublic

Description

Author: nicdumz

Description:
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 :)


Version: 1.13.x
Severity: enhancement

Attached:

Details

Reference
bz14094

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:14 PM
bzimport set Reference to bz14094.

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.

nicdumz wrote:

Thanks for the review :)

Committed, with your changes, in r35059