FANDOM


Forums: Yew Grove > Edit - Load - Insert, if blank inserts Main page BUG
Replacement filing cabinet
This page or section is an archive.
Please do not edit the contents of this page.
This thread was archived on 20 March 2008 by Endasil.

I did this by accident. If editing a page and clicking on the blue 'Insert' instead of the 'Save page' button and the 'Load the text of a page (enter the page name): is blank, it will insert the code for the main page. There have been recent edits (usually by new editors) where the main page has also been insert as well as their original edits. New editors may not notice this when they click on the 'Insert' button and not notice the change in the edit window as the window stays at the end of the last edit. When they notice the page has not changed, they then try again and hit 'Save page' saving their edits plus the Main page as well (about 4k additional bytes!). Who can make the change on the edit page to prevent the insertion of the main page and perhaps bring up a warning window if the Insert window is blank? Chrislee33 23:26, 4 March 2008 (UTC)

I've updated the javascript to check if the page name was specified before inserting it. If nothing was specified, the button will simply have no effect. Is this satisfactory? Thanks for pointing that out by the way. Endasil (Talk) @ 02:37, 5 March 2008 (UTC)
I should note that you can still insert the contents of the main page by entering "Main Page" in the textbox. I simply disallowed an empty box, which by default loaded the main page previously. Endasil (Talk) @ 02:40, 5 March 2008 (UTC)

Thanks. How about an error message 'Insert not done, no page name entered.'? Chrislee33 07:44, 5 March 2008 (UTC)

Alright, I gave it a default usage message when clicking insert with no page name specified. If you want to adjust the message, you can do so by observing my last change to Mediawiki:common.js; just make sure you only change what's inside of the quotes, and if you want to use a quotation mark in the message itself, do so with \" instead of simply " . Endasil (Talk) @ 10:05, 5 March 2008 (UTC)
Thanks! That should stop the accidental insertion of the main page now. Chrislee33 00:23, 6 March 2008 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.