{{SERVER}}{{localurl:{{{Link}}}|preload={{{Preload}}}&action=edit}}
1) When I do not put "&action=edit" in the code, the preload-parameter does not seem to work. Can someone explain why in this code the " &action=edit" MUST be there in order for the preload-parameter to be passed?
2) Where in the MediaWiki source code is it possible to adapt "action=edit"?
Thanks!
On 12/04/06, Jan Vanoverpelt jan.vanoverpelt@gmail.com wrote:
- When I do not put "&action=edit" in the code, the preload-parameter
does not seem to work. Can someone explain why in this code the " &action=edit" MUST be there in order for the preload-parameter to be passed?
Without the "action=edit" part, MediaWiki will attempt to view the article; this is the default action. When in this mode, the "preload" parameter is ignored; it means nothing to the code, and the value won't even be checked.
When in edit mode, however, the preload parameter *can* mean something, so the software will check for it and act as needed.
- Where in the MediaWiki source code is it possible to adapt "action=edit"?
The code that handles editing, from the start, is in includes/Wiki.php; look at MediaWiki::performAction() and the switch statement therein. This differentiates between internal and external editing, and passes off to the appropriate code. In most cases, this means a trip to the EditForm class, in includes/EditForm.php. A lot of other code is called in between; dig around.
Rob Church
2006/4/12, Rob Church robchur@gmail.com:
On 12/04/06, Jan Vanoverpelt jan.vanoverpelt@gmail.com wrote:
- When I do not put "&action=edit" in the code, the preload-parameter
does not seem to work. Can someone explain why in this code the " &action=edit" MUST be there in order for the preload-parameter to be
passed?
Without the "action=edit" part, MediaWiki will attempt to view the article; this is the default action. When in this mode, the "preload" parameter is ignored; it means nothing to the code, and the value won't even be checked.
Is there a possibility to change this, so that the "preload" parameter is not ignored without the "action=edit" part being present? So the code would become {{SERVER}}{{localurl:{{{Link}}}|preload={{{Preload}}}}}, the user views the article directly and when he wants to switch to the edit box he sees the preloaded text in this edit box and is able to add some additional text to it. Is that possible?
Thanks a lot!
Birger wrote:
2006/4/12, Rob Church robchur@gmail.com:
Without the "action=edit" part, MediaWiki will attempt to view the article; this is the default action. When in this mode, the "preload" parameter is ignored; it means nothing to the code, and the value won't even be checked.
Is there a possibility to change this, so that the "preload" parameter is not ignored without the "action=edit" part being present?
The "preload" parameter is *meaningless* when anything other than editing is going on.
So, no. That's not possible.
-- brion vibber (brion @ pobox.com)
Brion Vibber wrote:
Birger wrote:
2006/4/12, Rob Church robchur@gmail.com:
Without the "action=edit" part, MediaWiki will attempt to view the article; this is the default action. When in this mode, the "preload" parameter is ignored; it means nothing to the code, and the value won't even be checked.
Is there a possibility to change this, so that the "preload" parameter is not ignored without the "action=edit" part being present?
The "preload" parameter is *meaningless* when anything other than editing is going on.
It would make a certain amount of sense to trigger edit mode if the "preload" parameter is present _and_ the page does not yet exist, even if "action=edit" is not present.
I'll see if I can produce a patch.
Ilmari Karonen wrote:
It would make a certain amount of sense to trigger edit mode if the "preload" parameter is present _and_ the page does not yet exist, even if "action=edit" is not present.
I'll see if I can produce a patch.
Here's a quick hack that seems to work: http://vyznev.net/misc/preloadWithoutEdit.diff
To digress a bit, it seems to me like the division of labor between the MediaWiki and Article classes is somewhat suboptimal, as evidenced by the fact that such as simple change requires patching two different classes. In particular, the return value of Article::getContent() has too many different meanings -- I've encountered some cases before where MediaWiki "no such article" notices appear in the edit box when something unexpected happens and the code gets confused. (I think trying to edit an old revision of a deleted article can cause this, for example. That happens quite often when doing new pages patrol.)
Thanks a lot for the hack, but it seems i do not have a Wiki.php-file in my "/includes-folder"...i am using MediaWiki 1.5.2....should the code that normally fits into the Wiki.php-file be put in the EditPage.php-file or somewhere else? (there is no "function performAction( &$output, &$article, &$title, &$user, &$request ) {" in this EditPage.php-file).
Thanks again!
2006/4/12, Ilmari Karonen nospam@vyznev.net:
Ilmari Karonen wrote:
It would make a certain amount of sense to trigger edit mode if the "preload" parameter is present _and_ the page does not yet exist, even if "action=edit" is not present.
I'll see if I can produce a patch.
Here's a quick hack that seems to work: http://vyznev.net/misc/preloadWithoutEdit.diff
To digress a bit, it seems to me like the division of labor between the MediaWiki and Article classes is somewhat suboptimal, as evidenced by the fact that such as simple change requires patching two different classes. In particular, the return value of Article::getContent() has too many different meanings -- I've encountered some cases before where MediaWiki "no such article" notices appear in the edit box when something unexpected happens and the code gets confused. (I think trying to edit an old revision of a deleted article can cause this, for example. That happens quite often when doing new pages patrol.)
-- Ilmari Karonen _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org