Extension talk:CreateArticle

Valid MediaWiki Versions
If you've downloaded and used this extension and it works properly, please add your MediaWiki version to the following list. Thanks!


 * MW Version 1.6.9
 * MW Version 1.9.3 CreateArticele: works, Inputbox: fails

Hi,

i noticed two "problems" when running in Version 1.6.9

1. I had to comment out line 105 (rendering magic word PAGENAME) because of warnings in my html code on the start page rendered in the html code.

For me it is not a real big problem, because we do not need this functionality.
 * I'm puzzled over this; this line of code came directly from the Inputbox extension, which was the basis of this extension. Is there perhaps a conflict with something specific in your wiki? --Hoggwild5 19:30, 20 March 2007 (UTC)

2. Pressing the button with no text entered, causes an error on line 212 (i guess $title is empty, and ->getArticleID causes the problem)

Maybe it is not the "best solution" but i added the following to the if statement (line 212)

if(isset($title) && $title->getArticleID == 0) {

in this case, it will be handled as an aricitle that exists.

193.19.114.132--

I have to do some additions.

In my case, the statement at line 201 does not work.

if(is_null($title)){

i changed it into !isset($title) and it works

193.19.114.132--


 * '''The above errors were corrected with new source code posted on 20 Mar 2007 --Hoggwild5 22:57, 20 March 2007 (UTC)

Is it possible to have templates other than in the Mediawiki namespace on this? Or is it easy to create new templates in the mediawiki namespace?
 * if you have edit privileges to the MediaWiki namespace, creating a new template there is easy. I'll look at the possibility of using templates from other namespaces as well.  The logic I used here is the same as the Inputbox extension, so I'll need to take a look at source code to see if this is easily implemented. --Hoggwild5 23:01, 20 March 2007 (UTC)

Another thought: What if this create article triggered a form entry rather just adding the template to the edit view? -j --198.70.22.217 17:40, 19 March 2007 (UTC)
 * I am working on a form entry extension, and the primary purpose of this extension with the ability to add namespaces and/or subpages to an article title without user intervention is to set up the appropriate triggers for a form entry screen. This capability is under development. --Hoggwild5 23:01, 20 March 2007 (UTC)


 * Will you be posting that here or keeping a log of progress somewhere? -j --198.70.22.217 13:45, 26 March 2007 (UTC)

Problem in MW 1.9.3 with PHP 5.1.6
If you get 'createbox: type not defined.', the culprit is the 'htmlspecialchars' function below: /* Parses tag input arguments */ function getCreateBoxOption(&$value,&$input,$name,$isNumber=false) { if(preg_match("/^\s*$name\s*=\s*(.*)/mi",$input,$matches)) { if($isNumber) { $value=intval($matches[1]); } else { $value=htmlspecialchars($matches[1]); }       } }

Then try the following: /* Parses tag input arguments */ function getCreateBoxOption(&$value,&$input,$name,$isNumber=false) { if(preg_match("/^\s*$name\s*=\s*(.*)/mi",$input,$matches)) { if($isNumber) { $value=intval($matches[1]); } else { $value=trim(htmlspecialchars($matches[1])); }       } }

Hope this helps, Jean-Lou Dupont 14:08, 26 March 2007 (UTC)

Preload, supage and prefix do not work in Version 0.91 beta (20 Mar 2007) of the extension
Workaround:

function accRedirect($title, $action) {   global $wgRequest, $wgOut; $query = "action=edit&section=". $wgRequest->getVal('section'). "&createintro=". $wgRequest->getVal('createintro'). /* New code*/ "&prefix=". $wgRequest->getVal('prefix'). "&preload=". $wgRequest->getVal('preload'). "&subpage=". $wgRequest->getVal('subpage'). "&editintro=". $wgRequest->getVal('editintro') ; $wgOut->setSquidMaxage( 1200 ); $wgOut->redirect($title->getFullURL( $query ), '301'); }

Basic error checking
Can you add some javascript and/or PHP (fallback) error checking to verify/validate the input field isn't empty and, optionally, to verify the prefix isn't entered? Thanks. -Eep² 19:02, 30 July 2007 (UTC)

More suggestions
-Eep² 12:50, 3 August 2007 (UTC)
 * If a page already exists, go into edit mode instead of giving an error.
 * An option to call templates - I want to create automated pages and just want to enter the name in and have the template apply the name to various fields in the template. Eventually I don't even want the newly created page to be editable once it's created by certain users, but that's another issue...


 * Preload plain text and formatted text without having to have it in a template. -Eep² 07:36, 7 August 2007 (UTC)

dynamic preload
I would like to preload text that is inserted by the user in the form. More specifically, I would like to let users insert a title and a date, create a new page with the inserted title as page-name and the inserted date as a category. like so:

form:

-title

-date

result:

editing title

Is that somehow possible?

need some support
Hi,

i wanna use some parts of your extension to finish my wizard extension.

So at the last step of the wizard - which leeds users to write new articles - the title comes from a session var.

The crate article box has to be added to a pageobject

$page=array (           "step" => "4",            "title" => wfMsg('naw_title_page_4', '4', '4'),            "caption" => utf8_encode(wfMsg('naw_caption_page_4')),            "body" => $this->renderCreatebox            );

$this->addWizardPage($page);

But function renderCreatebox($input, $params,&$parser) assumes 3 params. So is there a way I can handle this

Thanks mic (info@hafenvolleyballer.de)