Page MenuHomePhabricator

EditPage should fail gracefully when getting incompatible model/format values
Closed, ResolvedPublic

Description

Per bug 41309 [1], it was possible to specify action=edit&model=fjlsgk (or even something like css)

Then click preview and see fatal exception.

https://bugzilla.wikimedia.org/show_bug.cgi?id=41309

Per gerrit change 29616, we use only the default model and format now:

https://gerrit.wikimedia.org/r/#/c/29616/1/includes/EditPage.php

Just want to ask if there is any reason for allowing these parameters in EditPage? If so, there were some to-do items in the code and we should implement it in a better way.

Until then, I don't see benefit of having these parameters in EditPage.


Version: 1.21.x
Severity: normal

Details

Reference
bz41315

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:10 AM
bzimport set Reference to bz41315.
bzimport added a subscriber: Unknown Object (MLST).

Yes, they are needed to edit any page that uses a non-default text-based content model. For example, if there was for some reason a CSS page in the Help namespace, removing these parameters would cause the CSS to be treated as wikitext upon save.

As long as only the default content type (derived from the namespace and other parts of the page title) is used, these parameters are not needed. But as soon as this is not the case, we *will* need them.

See also my comments to I93be7c4e

I think we do need parameters, and editing should fail for invalid content models, but perhaps not with a fatal error or internal error. We should check earlier and report more nicely.

Shall we re-purpose this ticket for that, or shall we open a new one?

either works for me. this was mainly a discussion item but if we can decide on a solution and implement it, then bug fixed

Note: As this has the 1.21.0 target milestone set (by Krinkle), somebody would have to make a decision (see comment 3 by Daniel Kinzler and comment 4 by Aude). If this does not receive a decision / patch in the next weeks, the Target Milestone will likely get removed.

Aude / Daniel:

(In reply to Umherirrender from comment #6)

Already fixed with bug 57615?