Extension talk:SpecialForm

SQL Error
I can't get this to run, and the error isn't a lot of help. I installed this on a 1.9.0 version MediaWiki installation running MySQL 4.0.27. When I submit the FirstForm example, I get:

Database error A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "". MySQL returned error "1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 (localhost)".

Any idea what to check? --ScareCrow 12:46, 4 February 2007 (UTC)

Hi Stéphane,

I am getting the same error that ScareCrow is getting in version 1.6.9; in addition, I get the following:

Notice: Undefined variable fname in ...\www\wiki\extensions\SpecialForm.php on line 130.

I also have tested this in version 1.8.3 and version 1.9.2, and the extension is not working in either of those versions; plus the Special:Version page will not display in either 1.8.3 or 1.9.2 when this extension is installed. In version 1.8.3, I get numerous notices about undefined INDEX:

In version 1.9.2, the form fields don't display; just the send button.

I would love to get this working; it's exactly what I've been looking for! I look forward to your response.

--Hoggwild5 18:39, 16 February 2007 (UTC)

I'm also getting a database error:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

(SQL query hidden)

from within function "". MySQL returned error "1146: Table 'databasename.suffix' doesn't exist (localhost)".

I attempted to create the table in my database manually, following the script's naming convention, but I was getting the error:

Too bad, it looks like a potentially useful script. - Fideri
 * 1) 1103 - Incorrect table name 'databasename.suffix'

Fix
I had a similar error. You need to change this line to:

$tablesResult = $dbr->query("SHOW TABLES FROM `$database`;", $dbLink) or die(wfMsg("formquerryfailed"));


 * Thanks ;-)
 * Sbrunner 13:38, 20 March 2007 (UTC)


 * The fix kind of works. The script now creates the database and enters that data, but I can't retrieve it in mediawiki. I get the permission error "You are not allowed to execute the action you have requested". I thought that as Sysop, I had all the rights? Anyhow, I created a new group "showform" in LocalSettings.php as follows: "$wgGroupPermissions['showform']['read'] = true;" and assigned myself the relevant user rights but I still get the same error. Am I missing something? I also tried to use the updated script by it doesn't work for me - template issues, I think. - Fideri


 * The right code is :

$wgGroupPermissions['showeform']['showform'] = true;
 * To create a new group with showform rights.
 * CU Stéphane 06:47, 13 May 2007 (UTC)

Suggestion for documentation
What's an inscription? Some explanation or definition would be helpful for those of us new to the term. I wasn't sure if this extension would be useful to me or not because I didn't know what inscription meant. Sounds like it means a sign-up form or a list of interested persons who can sign up / register themselves / add themselves to the list. TylerRick 17:59, 26 February 2007 (UTC)

TylerRick, inscription (French word) means register. So you are right in your interpretation of the purpose of the script. It should allow you to collect certain information from your visitors and have it written in your database (it appears the script doesn't email you the information). You can then retrieve it for various purposes. Unfortunately, I can't get it to work. Fideri


 * Effectively inscription => register !
 * Yes it email information, You shoule add a tag
 * and the user should have a confirmed address in mediawiki ;-)
 * CU Sbrunner 13:38, 20 March 2007 (UTC)
 * CU Sbrunner 13:38, 20 March 2007 (UTC)

MediaWiki 1.9.2
Hello,

The extension looks great. Can't make it work on 1.9.2. No link appears in toolbox -> special pages. (in French boîte à outils -> pages spéciales).

Any plan to support multi-language and French by the way?

Please, help!

--Antoine Sirianni 13:03, 1 March 2007 (UTC)


 * Effectively there isn't special page in Special:Specialpages page.
 * You should create a page named Mediawiki:FirstForm then go to page Special:Form/FirstForm. Read again the install section.
 * CU Sbrunner 13:38, 20 March 2007 (UTC)

Radio Buttons?
Salut Stéphane,

D'abord, merci pour cet ajout merveilleux :) (First, thanks for the wonderful extension). I would like to use radio buttons on one of the forms I'll be using.  I can't seem to figure out the syntax for it.  Any ideas?  Merci encore. --Nicolas 21 Avril 2007


 * Hello !
 * pour les radio boutton je suis en train de tester que cela fonctionne bien, cela devrais arriver tout soudain ;-)
 * CU Stéphane 13:26, 3 May 2007 (UTC)

Fieldsets?
Is there a way to create different fieldsets within the one form? I'm looking at using your extension to create a fairly extensive form, more than just a registration form.

Thanks/Merci

--Vavroom 00:31, 28 April 2007 (UTC)


 * It will be added in the next version ;-)
 * CU Stéphane 13:47, 3 May 2007 (UTC)

Data retrieval
Why isn't this possible? Obviously, it is if the special page can view it so why not be able to pull in this tabular data into tables and the like? I'd rather not even deal with a MySQL table and just use wiki articles as the "tables", like how some table extensions do it. The problem I'm having is trying to get the TemplateTable table to retain the Semantic Forms links. DynamicPageList is too complicated and user-unfriendly, and I don't like all the wordy relations of Semantic MediaWiki's ask special page. :/ I just want a straightforward way to pull in table values from multiple categories/articles, configure which values go where (rows vs. columns), and allow configuration of which articles/categories are included in order to create something like this comparison table and allow this form to get all the data. Any ideas/suggestions to help me achieve this would be greatly appreciated! -Eep² 14:23, 25 July 2007 (UTC)


 * If I understand what you say, you want to gets the data of the registers and view it on an other page ?
 * CU Stéphane 09:08, 16 August 2007 (UTC)


 * Yes, but instead of using a database to store the data, how about using a wiki page? —Eep² 04:07, 17 August 2007 (UTC)

Script only enters one record
This is a wonderful script and exactly what I need for my current purposes - I'm working on a site to coordinate teaching at the Scottish Universities, and students need to be able to sign up for the program through a registration form.

The problem I'm having is the following: If I set $wgAutoCreateFormTable = true and the form doesn't already exist, it creates a table in the database and enters the record. Once the table contains one record already, the script produces an error, stating that the database table already exists. Turning off the variable doesn't work, as it goes through the registration, but doesn't enter the data into the database.

I've tried giving the database user full privileges on the table in question, that doesn't seem to solve anything.

Any help would be much appreciated.

Sincerely, Jan Hilmar

Edit: I have found a few sources of error in the code: Unfortunately, my knowledge of PHP is too limited to fix the code in a satisfactory manner, but I'm sure anyone with some PHP knowledge could sort out these problems?
 * It appears to me (with my very rudimentary knowledge of PHP) that the statement that checks the variable $wgAutoCreateFormVariable has no else, for when the variable is set to false. Thus, if it is set to false, the Code enters absolutely nothing into the database.
 * The function mysql_table_exists isn't working. A working version can be found at http://www.phpbuilder.com/board/archive/index.php/t-10207932.html (the second example that uses three parameters).
 * There is a problem somewhere in the else clause of the if(!mysql_table_exists) statement, in that it attempts to add Fields that already exist. Completely removing the else-clause makes the code run.

Jan