Extension talk:TemplateFormEditor

From mediawiki.org

Hi Andreas,
This is an excellent extension, easy install and easy use. Could it be possible to make some changes like following:

  • Add a specific tag for page editing using this extension like the picture shown

TemplateFormEditor edit tag.png

  • Use a specific parser like following to create and edit pages:
[[ pagename | TemplateFormEditor(or TFE) | Template pagename ]]

or users can use the parser functions like following:

{{#ifexist:[[pagename]] <!-- for editing pages when the page exist-->
   |[[ pagename | TemplateFormEditor(or TFE) | Template pagename ]] <!-- for creating pages when the page not exist -->
  • Make a specific date type like following:
= Type Definiton =
 * Operating System : oneof (Windows NT,Windows XP,......) // choose one! 
 * Fixd day : date(yyyy/mm/dd) - // or users can use dd/mm/yyyy format. 
  • I would like to Translate the extension in Chinese for public if you want to use translatewiki.net.

Thanks. :-) --Roc michael 00:06, 9 May 2009 (UTC)[reply]

Fatal error[edit]

Fatal error: Call to undefined method Title::userCanEdit() in /wiki/extensions/TemplateFormEdit/TemplateForm.Editor.php on line 92

Please try this fix:
92    if ( !$editpage->mTitle->userCan( 'edit' ) ) {
userCanEdit() has been removed from MediaWiki Rev.50951 (2009-05-24 08:59:39):--Dick K 23:05, 3 January 2011 (UTC)[reply]

Conflicts with AbuseFilter[edit]

When TamplateFormEditor is installed, and you try to edit a page with a template, if you have a filter it does not work. For example i tried to edit an article with this filter enabled:

article_namespace == 0 & (line1:="(?<!\[\[[Ff]ile:)(?<!\[\[[Ii]mage:)(?<!\|[Ii][Dd]=)(\b[^\s\]\[\{\}\\\|^\/`<>=@:\"']+@\w+(?!\.[Hh][Tt][Mm])(?!\.(?:[Jj][Pp][Gg]|[Pp][Nn][Gg]))(?:\.\w+){1,3})"; rcount(line1, added_lines) >0)

wich works perfectly when you try to edit an article wich does not have a template on it.

If you try to ad an email adress in some of the fields on the Form, and hit SavePage button, it does not trigger the filter, but if you try to edit and article that does not have a template on it and you try to add and email adress, you see a warning telling you about the action if you set the filter to do so. I think, these behavior is related with TemplateFormEditor extension. Please can anyone tell me what is going on ?

Detected bug in an extension! Hook clsTemplateForm::eventhandler failed to return a value[edit]

It reports the following error when using MediaWiki 1.16.2 with PHP 5.3.3:

Detected bug in an extension! Hook clsTemplateForm::eventhandler failed to return a value; should return true to continue hook processing or false to abort.
#0 xxxxxx/wiki/includes/EditPage.php(288): wfRunHooks('AlternateEdit', Array)
#1 xxxxxx/wiki/includes/EditPage.php(271): EditPage->edit()
#2 xxxxxx/includes/Wiki.php(553): EditPage->submit()
#3 xxxxxx/includes/Wiki.php(70): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#4 xxxxxx/wiki/index.php(117): MediaWiki->performRequestForTitle(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
#5 {main}

Changes I made to get it working: 1. Editing line 14 of TemplateForm.Editor.php from

static function eventhandler( &$editpage ) {


static function eventhandler( $editpage ) {

I believe this is a PHP 5.3.x change

2. Edit line 92 of TemplateForm.Editor.php as mentioned below, from:

if ( !$editpage->mTitle->userCanEdit() ) {


if ( !$editpage->mTitle->userCan( 'edit' ) ) {

3. Edit line 107 of Templateform.UI.php from

'  <tr>'.$n.'    <td width="1%" warp="nowarp">' . wfMsg('editsummary').


'  <tr>'.$n.'    <td width="1%" warp="nowarp">' . wfMsg('summary').

4. Edit line 124 of Templateform.UI.php from

 . self::inputTag('submit',"wpDisable" ,wfMsg('wikitext'))

to change "wikitext" to something valid, I don't have direct access to the DB to check what are valid values.