Extension talk:Page Forms

Is there anyway to use this extension with another. If I wanted to use lets say.. the imagemap extension for an input instead of the input types that I can use with the semantic forms already? --198.70.22.217 19:58, 29 May 2007 (UTC)


 * I don't really understand how that would work. The imagemap extension, as far I know, just arranges links within an image; it doesn't allow for data input. Yaron Koren 00:05, 30 May 2007 (UTC)

You are right, that is a bad example. More along the lines of a flash video extension or something like that. More importantly, just any extension that requires some sort of input. --72.21.245.86 12:44, 30 May 2007 (UTC)


 * There would be no automatic way to combine the extensions, no; but if someone wanted to write code for data entry in Flash (or, say, AJAX), I'd certainly look into combining the two in some way, because that would be a neat feature. Yaron Koren 14:43, 1 June 2007 (UTC)


 * To continue this discussion a little, is it not possible to be able to use wikitext in any of the input types?? Would that be difficult to implement? --75.107.9.104 02:24, 29 July 2007 (UTC)


 * It's a possible enhancement. Yaron Koren 16:46, 30 July 2007 (UTC)


 * I think this would be a wonderful enhancement!!! I think what you have done already is just specatular, but something like this would make me feel like a little boy getting a puppy for the first time!!!--198.70.22.217 17:25, 30 July 2007 (UTC)


 * Yea, I need to be able to use wiki markup text in forms instead of HTML (linking to same-wiki links is annoying using HTML, for example, when it would be much easier with wiki markup). —Eep² 03:49, 15 August 2007 (UTC)


 * You can use wiki markup in the freetext area, can't you?--Robert Buzink 13:53, 3 September 2007 (UTC)


 * Sure, but I need the wiki markup in the form titles to provide links to what they mean (or javascript/CSS popups). Having to write out URLs for local (and/or interwiki) links to wiki pages is ridiculous. —Eep² 02:20, 4 September 2007 (UTC)

Help Help
I'm new to the Wikipedia extensions. I tried installing this extension along with the recommended Semantic Wiki as had been instructed. Copied all files and included the statements as instructed into the LocalSettings.php file. But...I'm getting two errors that I'm not sure how to resolve.

I get the following error when I try to create a new template: Fatal error: Class 'SMWInlineQuery' not found in /wiki/extensions/SemanticForms/includes/SF_GlobalFunctions.php on line 161

I also get this error a couple of times if I tried to incorporate a template as part of the form: Fatal error: Cannot access protected property SMW_LanguageEn::$smwDatatypeLabels in /wiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 704

I am using the following: * MediaWiki: 1.10.1 * PHP: 5.2.3 (apache2handler) * MySQL: 4.0.18-log

Any help on this would be greatly appreciated. Thanks.


 * It sounds like you don't have Semantic MediaWiki installed; is that possible? Yaron Koren 14:16, 7 August 2007 (UTC)


 * I did install it. I tried running a very simple test with a couple of relations, and it looks like it's picking them up properly.  Is there any way to tell for sure whether it was properly installed or not?


 * If you're still having this problem, please contact me directly; this talk page is a very inefficient way of communicating. In general, that goes for everyone: if you have a question or a problem running this extension, you're better off emailing me directly, or joining the mailing list and posting the problem there. Yaron Koren 05:16, 13 August 2007 (UTC)

Creating a SemanticForm and using tags
Hi guys hope you can help. If I can get this working, this will be a MAJOR thing for us :>)

Example: Lets say I have an extension called NewTaskTag, which lets you insert a  into a wiki page, then you manually insert parameters as follows..

 Task = This task completed at.. Time = 6pm Priority = Severe Updated by =   Task = Time = Priority = Updated by = 

The extension then renders the html into a table like format.

Because this is a manual job, I wanted to make it easier to do this.

So, Ive installed Semantic Mediawiki along with SemanticForms.

These are great, but I wanted to know if you could use a form to do the above instead of using the normal edit option with Mediawiki.

The problem I see is how will the form know how to interpret and pass the entered bits/eg. the fields to the extension, and how would you say, in a form, place a filed to say to use ?

To further clarify what Im trying to say is the following.

If I want to use the  in a wiki page, I just go to a new page, click on Edit, and enter the following:

 Task = Time = Priority = Updated by =   Task = Time = Priority = Updated by = 

I then complete each line, eg.Task = This new task, Time = 6pm, etc etc.

What Id like to do is the following:

Create a new form that has this format:

Task: [___ Text Box for Task entry___] Time: [___ Text Box for Time entry___] Priority: [___ Text Box for Priority entry___] Updated By: [___ Text Box for Updated By entry___]

All the user would have to do is then input in the text boxes the required data, then the  would do the rest. The questions I have though are:

1)How would the form know that each text box is actually in the format: Task = to proper wiki tables.


 * The reason you need to do all these re-saves is because of an SMW bug (which can be fixed) - it's in the SF documentation now, under "Semantic Forms issues". Yaron Koren 23:25, 24 January 2008 (UTC)

Adding Namespaces
I would like to add some namespaces to our wiki after having installed "semantic wiki" and "semantic forms". Now I am not sure which ones I can use. In the "LocalSetting.php" I put $sfgNamespaceIndex = 150. Does that mean that I can continoue with the namespace 152 ? My best, --Gollum 12:23, 26 January 2008 (UTC)


 * Yeah, you can use a lot of namespace numbers, but 152 should work fine. Yaron Koren 02:58, 28 January 2008 (UTC)

strange Characters show up on german sematic wikis
Having installed semantic forms on a german wiki (http://wiki-products.org) there are some problems with displaying some of the page titles. E.g. in special pages it says: "&lt;createcategory&gt;" instead of "Erstelle eine Kategorie". Also the form page itself (in the second step) (http://de.wiki-products.org/Formular:Fahrzeuge) shows a strange title e.g. "&lt;sf_adddata_title&gt;" instead of "Füge Seite hinzu:Audi A4 TDI". Is there anything I cn do about this? Everything else seems to be working fine. Keep up the good work! My best, --Gollum 12:48, 26 January 2008 (UTC)


 * Hi, congratulations on releasing your wiki. What you're seeing are some language values that weren't translated. It looks like you're using an old version of SF; if you upgrade to the latest version, those problems should go away. You should probably upgrade to the latest version of SMW while you're at it. Yaron Koren 16:27, 27 January 2008 (UTC)


 * Perfect, that worked! Thank you very much!! --Gollum 08:17, 8 February 2008 (UTC)

Upgraded from Sematic 1.0-RC3 to 1.0 and Edit with Form has disappeared
I had a completely working system running Mediawiki 1.11, PHP 5.2.5, MySQL 5.45a, Semantic wiki 1.0-RC3 and Sematic Forms 0.9.2. I upgraded Semantic wiki to 1.0 and followed the upgrade procedure carefully. Now the "Edit with Form" tab has disappeared from all my templated forms. I have the categories set correctly with Has default form::Form: Any help greatly appreciated. Fixed Sematic wiki has an upgrade script SMW_refreshData.php. Naturally I ran this after installing sematic 1.0. However, I did not run it after I upgraded Forms to 0.9.2. I ran the script again and the "Edit with Form" tab appeared again.

Errors showing after Edit with Form save
I'm running Mediawiki 1.11, PHP 5.2.5, MySQL 5.45a, Semantic wiki 1.0 and Sematic Forms 0.9.2. After clicking "Save Page" on the Edit with Form page, the following 4 notices are shown at the top of the page: Notice: Undefined offset: 0 in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 465 Notice: Undefined offset: 1 in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 465 Notice: Undefined offset: 0 in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 465 Notice: Undefined offset: 1 in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 465


 * That problem should be gone in version 0.9.3 (just released). Yaron Koren 00:04, 5 February 2008 (UTC)

Fast work! Thanks Yoran :) However I'm now getting the following error: Notice: Undefined index: free text in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.in on line 456 Of course, it's only on forms that have the default free text section at the bottom.

I'm also getting the following errors when adding data with my forms: Notice: Undefined index: Title in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 456

Notice: Undefined index: Status in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 456

Notice: Undefined index: Owner in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 456

Notice: Undefined index: EM in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 456

Notice: Undefined index: Progress in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 456

Notice: Undefined index: PTS in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 456

Notice: Undefined index: Dependencies in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 456

Notice: Undefined index: Background, Description and Business Rationale in /var/www/mediawiki/extensions/SemanticForms/includes/SF_FormPrinter.inc on line 456

There is one error for each property within the form. All forms are throwing similar errors.


 * Yikes! Apparently I hadn't fixed things fully for sites with PHP in debug mode. I fixed it now, so if you re-get the latest version, it should work fine (let me know if it doesn't). Also, my name's Yaron. Yaron Koren 16:50, 5 February 2008 (UTC)

Fantastic. That's fixed it Yaron. Great job. Sorry about getting your name wrong. I had some sort of vowel dyslexia going on there!


 * Cool, I'm glad it worked. Yaron Koren 18:39, 8 February 2008 (UTC)

drop down menue does not appear
I really like the way this form creates drop-down menues with properties that allowa only a limited range of values. It worked perfect in one case (Form for cars), but did not work in the second case (Form for Handys). I really looked carefully for any differences in the way it set up the two, but could not find any. Are there probably some less obvious reasons for this? --Gollum 21:31, 8 February 2008 (UTC)


 * Hi, which field(s) are supposed to have a dropdown? Also, it's generally better to use the mailing list for questions like this than this talk page. Yaron Koren 22:35, 8 February 2008 (UTC)

It's the "nichtmehrproduziert" field. (Sorry for posting here, I will use the mailing list in the future...) My best, --Gollum 04:38, 9 February 2008 (UTC)


 * Hi, you've discovered a bug in SF; the first line of your "Handys" template is just a little too complex for SF to parse correctly. It reads:




 * If you change it to the following, it should work:




 * Eventually, SF's parsing will need to be improved. Yaron Koren 14:51, 10 February 2008 (UTC)


 * Hi Yaron, Thank you very much. This helped a lot. I fould a nice workaround for this issue and I think now everything works just fine. My best, --Gollum 19:55, 11 February 2008 (UTC)

more flexibility with autocomplete ?
Hi Yaron,

thanks for the good work on SF!

Is it possible to use non-page-type values for auto completion? As far as I understand you either have to specify a namespace or a category and the auto completion is based on a search in the 'pages' table of the wikiDB. Is there an option to check against the set of 'so-far-used' values for a property (regardless of its type)? Is it possible to have a user template exit for the auto completion feature (something like 'autocomplete by template')? The template would receive the characters typed in so far and it would return the list of suggestions, maybe as a comma separated list of values?


 * Algorithmix 17:39, 22 February 2008 (UTC)


 * Hi, thanks. The first question isn't a bad idea; there's no reason why string properties shouldn't be allowed to have autocompletion. You could have a parameter in the field definition called "autocomplete on property" or even just "autocomplete", to indicate that this field should have autocompletion even though it's not a page-type property. Or maybe that should even be the default... The second question I don't understand - are you talking about a template to let you format the results of an autocompletion, so that, for instance, you could have an image show up alongside every result? Yaron Koren 20:51, 22 February 2008 (UTC)

Problem with "edit with form" when using "Allow for multiple (or zero) instances" check box for templates
I first want to compliment you on a great extension.

The problem that I have is when I try to edit a form with multiples of the same template. I have created a form that has a template called "distribution". When I created the form, I selected the zero or multiple checkbox for the template. When I go and create the form for the first time, I can add multiple "distribution" templates and edit the form just fine. However, when I go back and edit the form later to add another "distribution" template, it overwrites the first "distribution" template and the rest of the templates remain intact. Is this operator error, a problem with how I created the form, or is it how the "edit with form" saves the page? Has anyone seen this before.

I am using mediawiki 1.11.1 and SF 0.9.5 and Semantic Mediawiki 1.0.1


 * Hi, thank you. Sorry, I don't understand your question - you edited the form to have two multiple templates, both with the name "distribution"? If so, you shouldn't do that - it'll confuse the parser. Though maybe I just didn't understand. Yaron Koren 04:08, 24 February 2008 (UTC)

Yaron, I think I may know what's going on here. When I use a for template construct such as ...

tag:

the entry of multiple templates works OK the first time, however when I re-edit the form and add a few more templates the first templates get replaced with the added data when it should be adding it to the end of the collection of templates. It seems to be related to the num_elements global variable starting counting from 0 and [num] being replaced with the global value. The changes below fixes the addInstance function for this addition --Ian Homer 20:24, 26 February 2008 (UTC)

function addInstance(starter_div_id, main_div_id, tab_index, last_instance_num) { if (!last_instance_num) var last_instance_num=0; .... children[x].name = children[x].name.replace(/\[num\]/g, '[' + (num_elements + last_instance_num) + ']');

and with passing of the instance number in to the addInstance call:



It seems to work even when there are two "for template" loops (with different template names) in the form even though the num_elements variable is global.


 * Okay, now I know what the issue is. As noted today on the mailing list, this is a bug that I accidentally introduced a few weeks ago, in version 0.9.2. It'll be fixed in the next version, coming soon; there's actually an easier fix than this one. Yaron Koren 03:42, 27 February 2008 (UTC)


 * This bug is a very serious problem for me - it has disrupted some mission-critical operations in my student government. Will a fix be available soon?  Do you recommend the hack listed above until then?


 * I can't tell you how much we at SUNY New Paltz appreciate your amazing work. This extension is the best thing to happen to campus activism since the cell phone.  Thank you very much. RadicalHarmony 03:20, 28 February 2008 (UTC)


 * Wow, gosh, thanks. It's funny how I usually get compliments only in the midst of bug reports - you all are subconsciously encouraging me to keep introducing bugs. :) In any case, this problem should have been fixed in the latest version, 0.9.7, released earlier today. Try upgrading to that one and see if it works. Yaron Koren 04:28, 28 February 2008 (UTC)

Crash when adding data to a form
I've upgraded from 0.9.3 to 0.9.7 and now one of my forms has died. When I click the Add or edit button I get: Fatal error: Call to a member function getNamespace on a non-object in /var/www/mediawiki/includes/Article.php on line 160 In the httpd log I see: [Fri Feb 29 14:37:24 2008] [error] [client 127.0.0.1] PHP Fatal error: Call to a member function getNamespace on a non-object in /var/www/mediawiki/includes/Article.php on line 160, referer: http://localhost/mediawiki/index.php/Special:AddPage/PREQ

I have a number of forms and only one of them is doing this.

Here's the the template and form:

Template

This is the 'PREQ' template. It should be called in the following format:

Edit the page to see the template text.

Form

This is the 'PREQ' form. To add a page with this form, enter the page name below; if a page with that name already exists, you will be sent to a form to edit that page.

Free text

Any help greatly appreciated!


 * Hi, can you try removing one field at a time from the form, and seeing at what point the form starts working again? My guess is that it's one field in the form, through some combination of what's in the form definition, what's in the template, and the semantic property it covers, that's causing this error. Please let me know what you find. Yaron Koren 16:44, 29 February 2008 (UTC)

Populating input type=listbox
So I've got a listbox and it corresponds to property that has a finite list of allowed values. How do I get the listbox to be populated with those values? —Sledged (talk) 19:34, 29 February 2008 (UTC)


 * That should happen automatically... feel free to send me the form and template source, if it's not a public wiki. Yaron Koren 20:44, 29 February 2008 (UTC)


 * Thanks. Fortunately, I was able to figure out the problem, but now I have another question.  My finite list of values are links.  Example:

* Page]]


 * This shows up in the listbox as wiki syntax ( Page </tt>). Is there any way to have to have the displayed text different from the underlying value? —Sledged (talk) 20:58, 29 February 2008 (UTC)


 * Yeah, you should have the tag instead be Page . Yaron Koren 21:41, 29 February 2008 (UTC)


 * That gives me  Namespace:Page </tt> displayed in the list box and the same thing for the wikitext in the created/edited page. What I want the listbox to display is Page</tt>, and produce the wiki-markup  Page </tt> in the created/edited page.
 * I've also tried [ [Allows value:=Page|[ [Namespace:Page|Page]]]]</tt> and Page|Page]]</tt>, neither of which gives me the results for which I'm looking. —Sledged (talk) 21:59, 29 February 2008 (UTC)
 * Oh, I see. I think you're confusing properties and templates; I think what you want is Allows value:=Page in the property page, and Some property:=Namespace: in the template. Yaron Koren 22:20, 29 February 2008 (UTC)