Last modified: 2008-12-19 21:45:20 UTC
It's possible to create empty pages using {{subst:ns:0}} or {{subst:<an empty template>}}. Kinda confuses people when empty pages are created.
I think it would be necessary to move the check on line 785 of EditPage.php, in interalAttemptSave(), a level down to after the pre-save transform in Article::doEdit. Or alternatively, move the PST a level up. The latter is clearly undesirable; any save needs to be accompanied by PST, even if it's not through EditPage. The former seems feasible enough. Presumably you could save an empty page at present using the API, for instance (unless they've duplicated yet more logic), which this would prevent. We could just allow empty articles to be created to begin with. I mean, if you really want to create an empty article, that's sort of weird, but why not? Maybe you're doing some #ifexist hackery or God knows what.
(In reply to comment #1) > I think it would be necessary to move the check on line 785 of EditPage.php, in > interalAttemptSave(), a level down to after the pre-save transform in > Article::doEdit. Or alternatively, move the PST a level up. The latter is > clearly undesirable; any save needs to be accompanied by PST, even if it's not > through EditPage. The former seems feasible enough. Presumably you could save > an empty page at present using the API, for instance (unless they've duplicated > yet more logic), which this would prevent. The API presently doesn't implement page editing/creation (there is an unmaintained and messy implementation written by the Vodafone folks), but any implementation in the future will use internalAttemptSave(). This means the PST should happen in internalAttemptSave() or in a function called by it (like doEdit()).
Well, at any rate Article::doEdit() isn't private, so it will affect *something*. A few maintenance scripts, several SVN extensions, and includes/filerepo/LocalFile.php all use Article::doEdit() directly.
Note that the reason we don't create blank pages is so that if you click a red link, then just submit the form, it doesn't create a useless blank page just because you were confused about what this wiki thing is. If you want to go out of your way to make it so it turns out blank, well that's a bit silly but hardly the end of the world. We do allow saving blank pages after all.
Resolving INVALID, since the issue doesn't apply to the reason we don't create empty pages.