Extension talk:Page Forms

How to show an Enumeration with Checkboxes using newlines, rather than comma-separated list
Hi! I figured out how to create an enumeration that shows up with checkboxes in the form; and with a comma-separated list in the displayed template. I'm using

In the template and

In the code. The problem is that the categories tend to be long, so I would prefer the display to use a newline-separated list both in the form and in the display. If I change the separator from comma to '\n\n', which the documentation seems to suggest, then the form still shows the categories on one line, and the result display just gives an error (something like 'invalid value for field'). How do I accomplish showing the combo boxes on top of one another, and the result display also on top of one another.


 * For the form, see here. For the template, it's not the "delimiter" parameter that you should set to "\n\n" (that one should stay as a comma), but the "new delimiter" parameter, which needs to be added at the end. Yaron Koren (talk) 17:11, 30 January 2015 (UTC)

The 2nd template of a form disappeared when editing with form
Hi ! I have created a from with the Special:CreateForm page.

I have added 2 elements in this form :
 * One template (I will call it template 1)
 * Another template (I will call it template 2)

I clicked on "Allow for multiple (or zero) instances of this template in the created page" for the template 2 only and I saved my form.

Then I used the form. Everything works great :
 * I could enter data on template 1 and on template 2
 * I could also add another instance on template 2 and enter data.

I saved and the results page looks great.

But, when I wanted to modify the data, I clicked on "Edit with form" and, at that moment only the form of template 1 was displayed. The form of Template 2 and its instances had disappeared...

Any idea why ? Thanks a lot.


 * If you go back to the form definition page, are both templates still there? Yaron Koren (talk) 23:43, 28 January 2015 (UTC)


 * Hi Yaron, ok I got it : this is because I forgot to create a Category for my form. Another mistake I may also have made : I had also create 3 forms : One for template 1. One for the template 2. And a last one to combine both templates into one. I don't know if that had an impact on my bug. I assume it shouldn't... In my case, I don't need users to fill the 2 first forms separately so I have created 2 templates and call them into a unique form. Thanks a lot for your great and quick support ! I love your Semantic extension. It's awesome.

My pages Special:CreateProperty and Special:CreateClass don't show up...
Hi ! I have installed the extension on a clean new mediawiki website (English Version) but I am facing the following bugs :

Special:CreateProperty and Special:CreateClass doesn't show up ! I get a "No such special page. You have requested an invalid special page."

Moreover, when I am logged in, I get a 500 error on my page Special:Preferences...

However, I think the Semantic Forms Extension is installed correctly since I get the line into my Installed extensions on the Special:Version page.

Any idea why ?

Version :


 * MediaWiki : 1.24.1
 * SF : 3.0
 * PHP Version : 5.4.34

Thanks for your support.


 * My guess is that you don't have the Semantic MediaWiki extension installed. The Special:Preferences thing seems like a separate error, though. Yaron Koren (talk) 14:50, 7 January 2015 (UTC)

multiple instance template not working anymore after version changes. Any idea why ?
My form http://coetus.eu/wiki/Formulaire:SUITE used to work on mediawiki 1.19, including the template multiple :

Yet after I moved to mediawiki 1.23 and to semantic package, the button "Ajouter un tome dans la suite" is not active anymore, i.e. when I clic on it, nothing happens.

To make sure this is not due to my browser, I tried your sample page on http://discoursedb.org/wiki/Special:FormEdit/Item/An_example_item and that one works perfectly i.e. when I click on any of the two "add another" button, I get the expected behaviour i.e. a new series of fields presented.

Do you have the same problem with my form on your side, and do you have any clue on what I may have done wrong ?

Many thanks, and very best wishes for 2015 to you, and to the semantic wiki community.


 * It's great that the form is publicly available - that makes it much easier to debug with the browser JavaScript console. In your case, you have the error message "Unknown dependency: jquery.collapsibleTabs", which is preventing any other JS from running. I don't know what the source of that error is, though - maybe a custom extension? Yaron Koren (talk) 16:43, 5 January 2015 (UTC)
 * jquery.collapsibleTabs (see ) is used in extension Vector (see ). It doesn't compartible with current version of MW and SMW. Just disable it and enjoy! Dmitry Russkih (talk) 12:01, 28 January 2015 (UTC)
 * Spot on : I just had to edit out the call to Vector from my LocalSettings.php file, and everything started to work fine as before. Namely adding the // in : // require_once( "$IP/extensions/Vector/Vector.php" ); . Many thanks. 92.128.41.51 21:51, 16 February 2015 (UTC)

Idem by hdurre
I have the same problem : Button 'Add another' doesn't work / no effect. Same message : JS console => "Unknown dependency : jquery" Same version (the latest) : 1.24.1 Do you have workaroud ?


 * What version of Semantic Forms are you using? Yaron Koren (talk) 23:47, 28 January 2015 (UTC)

Multiple instances of RunQuery being turned into UNIQ ... QINU string
My problem seems to be related to some recent problems described here and here. I want to embed two RunQueries on a single pages (e.g., the page's source code looks something like

  

This works fine and dandy if I include just Form1 or Form2, but if I include them both like this, then Form1 doesn't display at all, and instead just shows a UNIQ ... QINU string like "UNIQ639ef22958a33d50-item-0--QINU". Here is some information about my set-up:


 * MediaWiki: 1.24.1
 * PHP: 5.5.7 (cgi-fcgi)
 * MySQL: 5.0.95
 * Semantic MediaWiki: 2.0
 * Semantic Forms: 3.0

My wiki is publicly accessible if you would like me to e-mail you the link so you can see the problem in action. Thanks in advance!

- 70.48.43.161 13:38, 5 January 2015 (UTC)

Field Auto-completion Filtered By Property
I'm trying to provide a combobox, where the auto-completion provides a list of pages in a namespace that contain a particular property, but I can't figure out if this is possible.

Specifically, I'm hoping to provide a dropdown of Machine's from which the user will select a Virtual Host, these Machine's having the Boolean property, Virtual Server, ticked.

I can get the combobox to display all Machines with the followingː

and I can see that there is documentation on values dependent on= but I can't quite join up if it is possible to use this to provide only other Machine's that have the Virtual Server property equal to 1.

Am I able to achieve what I'm after?

- Adam Carrgilson 11:33, 8 January 2015 (UTC)


 * You don't need "values dependent on", you need to replace "values from namespace" with either "values from category" or "values from concept", and then create a category or concept that matches the set of pages you need. "values from concept" would be the better approach - see the documentation for more information on that. Yaron Koren (talk) 15:55, 8 January 2015 (UTC)

transcluded in another page
Embedding a page that is in a sub-category

I tried the following with no effect, B still becomes a member of the category. Is there any way to fix this? If a page (which we'll call Page A) gets transcluded in another page (which we'll call Page B), and Page A belongs to a category that's associated with a form, it can have the unfortunate side effect of making Page B a member of that category as well, thus giving Page B an "edit with form" tab at the top, even if such a tab is not appropriate. You can solve this problem by putting the category declaration in Page A within a "&lt;noinclude&gt;" block, which will make Page A a member of that category but not Page B.


 * Sorry, I don't know. Yaron Koren (talk) 19:43, 8 January 2015 (UTC)

indexing multiple instance templates
I know this has been asked before, but I am just curious if there is any plan to implement this in the future. I attempted to modify the js file and add in the index field, but it does not work. I am not sure if the patch needs to be updated.

--Dgennaro 19:35, 13 January 2015 (UTC)


 * No, unfortunately there's still not a solution, though I do want to implement one. I think it would be cleaner to do via SIO or subobjects than in the form, but... whatever works. I should also note the order is preserved if the data is stored via Cargo, but that's a whole other story. Yaron Koren (talk) 21:49, 13 January 2015 (UTC)


 * I saw that. I plan to look into Cargo when I can come up for air. --Dgennaro 21:58, 13 January 2015 (UTC)

Multiple-instance template not working anymore (SF 2.7 -> SF 3.1)
I seem to be having this problem after upgrading from SF 2.7 to SF 3.1. In addition, the first combobox disappeared from the form view. When I replace all instances of input type=combobox in the form, the multiple-instance templates are working fine again. There's this in the debugging console:

"TypeError: jQuery(...).data(...) is undefined" TypeError: jQuery(...).data(...) is undefined Stacktrace: jQuery.fn.SemanticForms_registerInputInit@[...]extensions/SemanticForms/libs/SemanticForms.js:379:9 @[...]index.php?title=Form:[...]&action=submit:6921:77 handlePending@[...]load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20140604T100439Z:10317:10 runScript/markModuleReady@[...]load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20140604T100439Z:10457:8 runScript/nestedAddScript@[...]load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20140604T100439Z:10464:9 runScript/nestedAddScript/<@[...]load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20140604T100439Z:10469:9 addScript/script.onreadystatechange@[...]load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20140604T100439Z:10389:9

Cavila (MW 1.22, MySQL 5.5.37-0, Php 5.4.4-14 squeeze, SMW 1.9.2, SF 2.7) 11:16, 14 January 2015 (UTC)


 * Update: SF 3.0 has other, combobox-related issues but multiple-instance templates are working fine, so that should narrow down the issue to a fairly recent modification. Cavila (MW 1.22, MySQL 5.5.37-0, Php 5.4.4-14 squeeze, SMW 1.9.2, SF 2.7) 11:48, 14 January 2015 (UTC)


 * I assume this is happening on a private wiki. Could you try to replicate this problem on a public wiki, like scratchpad.referata.com? Also, what are the other combobox issues you're seeing? Yaron Koren (talk) 16:57, 14 January 2015 (UTC)


 * Hi Yaron,
 * 1. Using SF 3.0 (on at least one machine) and 3.1 (on another one), two comboboxes in my form were showing stray placeholders. On further investigation, it looked like the stray content probably came from MediaWiki:Sitenotice, where #formlink is used for ready access to a number of forms. SF's switch to the Select2 library probably helps to explain why this is happening now and not in earlier versions of SF.
 * 2. ...which made me wonder if the unresponsive multiple-instance templates (SF 3.1 only) could also be due to something related to the use of #formlink in MediaWiki:Sitenotice. To cut a long story short, it's the use of #formlink in combination with one or more #formlink parameters (I can't be much more specific I'm afraid) that's causing the trouble. It messes up some of the comboboxes, in turn leading to issues with multiple-instance templates.
 * The solution for me was to simplify #formlink, removing some of the unessential parameters, and the issues were gone! Cavila (MW 1.22, MySQL 5.5.37-0, Php 5.4.4-14 squeeze, SMW 1.9.2, SF 2.7) 14:25, 15 January 2015 (UTC)


 * Oh, great. And it's good to know that there might be an issue with #formlink - I'll have to look into it. Yaron Koren (talk) 22:21, 15 January 2015 (UTC)

Problem with losing session data while submitting form
I've been trying to work with the Semantic Form, but keep getting the "Sorry! We could not process your edit due to a loss of session data." error.

I've upgraded to 3.1 and (thinking there might be some issue with the Cargo additions) went back to 3.0. No dice.

I've updated in test and, thinking this might be a problem with something there, did an upgrade (to SMForms 3.0) in production just now. I'm still getting the "We could not process..." problem.

I tried instrumenting and tracing the code from where  fails and got the following as the first failure:

User::matchEditToken: broken session data 1f054b3425fd476a1bf9e17304d12282+\ != db0cba2825d4b644ba8a1a0cd2948714+\
 * 1) 0 extensions/SemanticForms/specials/SF_UploadWindow.php(98): User->matchEditToken('1f054b3425fd476...')
 * 2) 1 extensions/SemanticForms/specials/SF_UploadWindow.php(24): SFUploadWindow->loadRequest(Object(WebRequest))
 * 3) 2 includes/specialpage/SpecialPageFactory.php(385): SFUploadWindow->__construct
 * 4) 3 extensions/SemanticForms/includes/forminputs/SF_TextInput.php(111): SpecialPageFactory::getPage('UploadWindow')
 * 5) 4 extensions/SemanticForms/includes/forminputs/SF_TextInput.php(231): SFTextInput::uploadableHTML('input_2', NULL, '', 'test-upload3.sv...', Array)
 * 6) 5 extensions/SemanticForms/includes/SF_FormPrinter.php(1881): SFTextInput::getHTML('test-upload3.sv...', 'Unconventional ...', false, false, Array)
 * 7) 6 extensions/SemanticForms/includes/SF_FormPrinter.php(1334): SFFormPrinter->formFieldHTML(Object(SFFormField), 'test-upload3.sv...')
 * 8) 7 [internal function]: SFFormPrinter->formHTML(' \n<...', true, false, 47989, '', 'Sandbox test', NULL)
 * 9) 8 includes/StubObject.php(105): call_user_func_array(Array, Array)
 * 10) 9 includes/StubObject.php(125): StubObject->_call('formHTML', Array)
 * 11) 10 extensions/SemanticForms/includes/SF_AutoeditAPI.php(870): StubObject->__call('formHTML', Array)
 * 12) 11 extensions/SemanticForms/includes/SF_AutoeditAPI.php(870): StubObject->formHTML(' \n<...', true, false, 47989, '', 'Sandbox test', NULL)
 * 13) 12 extensions/SemanticForms/includes/SF_AutoeditAPI.php(116): SFAutoeditAPI->doAction
 * 14) 13 extensions/SemanticForms/specials/SF_FormEdit.php(92): SFAutoeditAPI->execute
 * 15) 14 extensions/SemanticForms/specials/SF_FormEdit.php(46): SFFormEdit::printForm('Unconventional_...', 'sandbox test', NULL)
 * 16) 15 includes/specialpage/SpecialPage.php(363): SFFormEdit->execute('Unconventional_...')
 * 17) 16 includes/specialpage/SpecialPageFactory.php(562): SpecialPage->run('Unconventional_...')
 * 18) 17 includes/MediaWiki.php(275): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
 * 19) 18 includes/MediaWiki.php(584): MediaWiki->performRequest
 * 20) 19 includes/MediaWiki.php(435): MediaWiki->main
 * 21) 20 index.php(46): MediaWiki->run
 * 22) 21 {main}SpecialPage::getContext called and $mContext is null. Return RequestContext::getMain; for sanity

Creating a form without any uploads in it (just a simple text entry) resulted in the same problem.

I poked around and saw other people with similar problems, but no clear solution.

Ideas? -- ☠ MarkAHershberger ☢ (talk) ☣ 22:53, 16 January 2015 (UTC)


 * That does sound like a problem with tokens, in some way. What version of MediaWiki are you using? And does this problem happen on a form with an "uploadable" input? And if so, does it also happen on forms without "uploadable? Also, where have you seen similar problems? I don't remember them, but maybe that would shed some light on this issue. Finally, it's not "SMForms", it's just SForms. :) Yaron Koren (talk)÷ 23:08, 16 January 2015‎ (UTC)
 * SForms... got it.
 * It happens on forms without "uploadable", too. I haven't seen similar problems on this wiki, except when you wait too long to submit.  That isn't the issue here.
 * I've instrumented  and   in the following way:

""
 * And, to demonstrate that this isn't a problem with uploadable, I've created the following simple form (this is copied from another form, since I haven't really dealt with forms before):




 * Submitting this form ends up with the following in the debug log:

*** getEditToken w/o request *** getEditToken before user check *** getEditToken token: MWCryptRand::realGenerate: Generating cryptographic random bytes for User::getEditToken/MWCryptRand::generateHex/MWCryptRand::realGenerateHex/MWCryptRand::generate/MWCryptRand::realGenerate MWCryptRand::realGenerate: openssl_random_pseudo_bytes generated 16 bytes of strong randomness. MWCryptRand::realGenerate: 0 bytes of randomness leftover in the buffer. *** getEditToken was null got c8477b8f9928be26955e36b0d3295736 *** getEditToken returning c8477b8f9928be26955e36b0d3295736 *** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 *** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 User::matchEditToken: broken session data 3514833eb1ab2367bc008b4bd487873e+\ != 337f3aae3ee72537c5773bd58d2e37b8+\ *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 EditPage::importFormData: Failed token check; forcing preview SFUtils::showFormPreview: enter. Title::getRestrictionTypes: applicable restrictions to Sandbox are {edit,move} *** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 User::matchEditToken: broken session data 3514833eb1ab2367bc008b4bd487873e+\ != 337f3aae3ee72537c5773bd58d2e37b8+\ *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 *** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 *** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 *** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9
 * 1) 0 includes/EditPage.php(1237): User->matchEditToken('3514833eb1ab236...')
 * 2) 1 includes/EditPage.php(798): EditPage->tokenOk(Object(FauxRequest))
 * 3) 2 extensions/SemanticForms/includes/SF_AutoeditAPI.php(374): EditPage->importFormData(Object(FauxRequest))
 * 4) 3 extensions/SemanticForms/includes/SF_AutoeditAPI.php(900): SFAutoeditAPI->setupEditPage('')
 * 5) 4 extensions/SemanticForms/includes/SF_AutoeditAPI.php(116): SFAutoeditAPI->doAction
 * 6) 5 extensions/SemanticForms/specials/SF_FormEdit.php(92): SFAutoeditAPI->execute
 * 7) 6 extensions/SemanticForms/specials/SF_FormEdit.php(46): SFFormEdit::printForm('Sandbox_test', '', NULL)
 * 8) 7 includes/specialpage/SpecialPage.php(363): SFFormEdit->execute('Sandbox_test')
 * 9) 8 includes/specialpage/SpecialPageFactory.php(562): SpecialPage->run('Sandbox_test')
 * 10) 9 includes/MediaWiki.php(275): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
 * 11) 10 includes/MediaWiki.php(584): MediaWiki->performRequest
 * 12) 11 includes/MediaWiki.php(435): MediaWiki->main
 * 13) 12 index.php(46): MediaWiki->run
 * 14) 13 {main} *** getEditToken w/o request
 * 1) 0 includes/EditPage.php(1237): User->matchEditToken('3514833eb1ab236...')
 * 2) 1 extensions/SemanticForms/includes/SF_AutoeditAPI.php(461): EditPage->tokenOk(Object(FauxRequest))
 * 3) 2 extensions/SemanticForms/includes/SF_AutoeditAPI.php(908): SFAutoeditAPI->doStore(Object(EditPage))
 * 4) 3 extensions/SemanticForms/includes/SF_AutoeditAPI.php(116): SFAutoeditAPI->doAction
 * 5) 4 extensions/SemanticForms/specials/SF_FormEdit.php(92): SFAutoeditAPI->execute
 * 6) 5 extensions/SemanticForms/specials/SF_FormEdit.php(46): SFFormEdit::printForm('Sandbox_test', '', NULL)
 * 7) 6 includes/specialpage/SpecialPage.php(363): SFFormEdit->execute('Sandbox_test')
 * 8) 7 includes/specialpage/SpecialPageFactory.php(562): SpecialPage->run('Sandbox_test')
 * 9) 8 includes/MediaWiki.php(275): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
 * 10) 9 includes/MediaWiki.php(584): MediaWiki->performRequest
 * 11) 10 includes/MediaWiki.php(435): MediaWiki->main
 * 12) 11 index.php(46): MediaWiki->run
 * 13) 12 {main} *** getEditToken w/o request
 * A sucessful edit on a non-SForms wiki page ends up with the following in the log:

*** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 User: got user 15838 from cache User: loading options for user 15838 from override cache. Title::getRestrictionTypes: applicable restrictions to User:Hershm are {edit,move} *** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 *** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9 *** getEditToken w/o request *** getEditToken before user check *** getEditToken token: 368f4813db995d79921958378cc7eaa9 *** getEditToken returning 368f4813db995d79921958378cc7eaa9
 * I could see this being a conflict with some other extensions, though. Any pointers there? -- ☠ MarkAHershberger ☢ (talk) ☣ 16:46, 17 January 2015 (UTC)


 * That's a lot of printout! First of all, it's just Semantic Forms or SF, not SForms - sorry about the confusion. As to the issue, I think it's a reasonable guess that the problem is due to some conflict with another extension, but I don't know anything more than that. Maybe try to disable/enable other extensions to try to isolate the problem, or just to make sure that that's not it? Yaron Koren (talk) 01:09, 19 January 2015 (UTC)
 * Just trying to be thorough!
 * I disabled most other extensions in the dev server and still had the problem. I'm using an updated and extended Auth remoteuser to handle SSO.  Like I said, everything else works, so maybe Semantic Forms has exposed a bug in my code or my code has exposed one in Semantic Forms!
 * Or, we could both be winners and each have a bug in our respective code base!
 * I'll go disable the extension now and see if I can get it to work. Thanks for your help. -- ☠ MarkAHershberger ☢ (talk) ☣ 21:32, 20 January 2015 (UTC)


 * Note that I downgraded to 2.7 (from 3.1) and the form submission works now, even with my mods. I don't think the problem only with my code. -- ☠ MarkAHershberger ☢ (talk) ☣ 01:36, 22 January 2015 (UTC)


 * After using git bisect, I tracked it down the patch for and added my comments to.


 * Interesting to see that someone is having the same problem at the same time as we have. Hopefully it can be resolved. But ... I would disagree with the notion that SF would be the only extension that runs wild. The system on which it is installed (SF + auth_remoteuser) has also a VisualEditor installed. The thing is that it is unclear why it works with the a_ru-Extension disabled, but not with an activated one. We have been able to bypass this problem -- and not in an elegant kind of way -- with a if-condition in the localsettings, which throws an error once the update routine is being used; not to mention in the phpunit test environment. We are not entirely sure whether not both mentioned extensions add together, each in their part, something to the problem. --Temptuousinsolence (talk) 11:02, 22 January 2015 (UTC)


 * I'm using VisualEditor as well, but I don't know what you're talking about with a_ru-Extension. Are you saying that the if-condition allows SemanticForms to work? (That would seem really odd, but I ask to be sure.) -- ☠ MarkAHershberger ☢ (talk) ☣ 23:00, 3 February 2015 (UTC)


 * Oh, and fwiw, I think this is a problem with the Auth_remoteuser extension and some bug that it has that Semantic Forms triggers. -- ☠ MarkAHershberger ☢ (talk) ☣ 23:02, 3 February 2015 (UTC)


 * I submitted a patch for this issue here. --Ike @ WikiWorks 00:53, 10 February 2015 (UTC)

Providing a dynamic file name (one-step process)
Heiya, is it possible to dynamically set a default file name for file uploads when using the one-step-process? So far this seems only to be possible when one wants to upload a file directly (file name = page name) and additionally annotate it with further information but not if the file to be uploaded just relates to the page to be created with with form. I do not think that this is if I am not mistaken. Cheers --&#91;&#91;kgh&#93;&#93; (talk) 20:05, 18 January 2015 (UTC)


 * I'm not sure I understand the question, but the "default filename" thing should always be possible to do. However, there's a major flaw in that feature, which is that the uploaded file has to have the same file type as the default filename is set with (like ".gif" or whatever it is); otherwise it won't work. Yaron Koren (talk) 01:31, 19 January 2015 (UTC)


 * Indeed, the file type is another issue. Providing a dynamic default filename based on the page name when creating a page through the one-step process is what I meant. One just ends up the the "Semantic Forms Permission error.jpg" as default filename. This is understandable since the form has now clue what it will be. However, doing it with e.g should work but the filename would not be very meaningful. At least it is unique. Probably a matter of compromise --&#91;&#91;kgh&#93;&#93; (talk) 09:29, 19 January 2015 (UTC)


 * Ah, based on the page name, now I get it. No, it's not possible; the file upload happens before the page is created. Yaron Koren (talk) 15:37, 19 January 2015 (UTC)


 * Thank you for confirming. Cheers --&#91;&#91;kgh&#93;&#93; (talk) 15:56, 19 January 2015 (UTC)

No multiple selection in "tree" input
There are no parameters to enable multiple selection in "tree" input. Proposed example also doesn't show this feature: see example. Dmitry Russkih (talk) 18:05, 20 January 2015 (UTC)


 * There is indeed a problem with that example, although it's due to a temporary issue involving Cargo. Anyway, you can always specify that the tree input should allow multiple values by adding "|list" to the field tag. (Maybe the documentation should be clearer on that.) Yaron Koren (talk) 19:03, 20 January 2015 (UTC)
 * Thanks! I've comlemented help page but I can't edit example page (capcha wonts one name, but system not accepted both 'Kerry' or 'John Kerry') Dmitry Russkih (talk) 00:04, 21 January 2015 (UTC)


 * Thanks. I purposely made that CAPTCHA "incorrect", because it was the only way to fully block spammers. I could just add in "|list" to the form, but instead I plan to fix the issue with template parsing in SF, so that it knows it's a list. To clarify, this particular bug only happens when the Cargo extension is installed. Yaron Koren (talk) 14:47, 21 January 2015 (UTC)

Practical examples
This documentation is really great work. One thing that would make it even more useful to me is if it had more practical examples. We use forms, and code for one of them can be seen here and this is what it looks like when entering new data. What we would like to add is an option to allow multiple values for the same field. This seems to be described here but I just don't get it without a practical example. Could someone point me to one? Thank you so much for your help! ReplicationWiki-fan (talk) 15:43, 24 January 2015 (UTC)


 * The form looks good! As noted in the documentation, the fact that a field holds a list of values is really defined in the template. See the "Cuisine" field here, for example. Yaron Koren (talk) 16:16, 25 January 2015 (UTC)


 * That's great, thank you. It somewhat worked for us as we now have a list of authors. However, this one seems to indicate that there is some error in our code because the last listed coauthor of a study is not listed. It might be because we use templates in templates with the form.? At least the array structure as described here and as we tried to copy from the example did not quite work. When we used the code as we thought we should we always ended up with two extra " ]] ". I guess there should also be some option to create all those author pages automatically via the category rather than adding the template to each one by hand? ReplicationWiki-fan (talk) 19:54, 3 February 2015 (UTC)


 * I didn't understand everything you wrote, but: you should remove the string " Yaron Koren (talk) 20:06, 3 February 2015 (UTC)


 * Ok, I deleted that string. Still for the last two of three co-authors their study is not listed on their pages while for the first one it works and I don't understand why.
 * I tried to include a #forminput tag on the category page but the result didn't make sense to me. Would I have to create a new form for this? And could I then fill the empty pages automatically with Creates pages with form::Authors ? ReplicationWiki-fan (talk) 23:28, 3 February 2015 (UTC)


 * It looks like you're querying on a different property than the one you're setting, for one thing - I don't know if that's the whole issue. What's the issue with the #forminput call? It looks fine to me. Yaron Koren (talk) 00:09, 4 February 2015 (UTC)


 * Hello User:ReplicationWiki-fan. Looking on this page it seems the following is happening:
 * First template call to  Template:New Replication :
 * Second template call to  Template:Article/replication/entry :
 * Where you set the property:
 * It is not clear to me how  end up in  Property:Article authors  because you seem to assign them to  Authors::...  but that is a property that does not seem to exist. You are also doing calls to templates and setting properties inside of a wikitable, this is possible but when you are debugging you should exclude anything that can break what you are trying to achieve. If you want to test a form you could start with a test page where you set your properties in the first template call, just setting the values no tables or anything else. Use non capitalized parameter names, this prevents any typos. When doing it like this you can be sure that your form will recognize the parameters you want to use. If that works just start adding what you want step by step and make sure it keeps working. In your form you could also use something like this:

'''
 * You can then set the property with  }} . Regards, --Felipe (talk) 08:30, 4 February 2015 (UTC)
 * Ok, I see I had mixed up something with "Article authors" and "authors". To be honest I just don't understand what a template call really is and how it works together with the forms and the category. I tried some changes   but then it seemed no authors were listed any longer. What makes things difficult to understand for me is that I know sometimes changes don't work immediately, one must wait until jobs are done and I do not know how long to wait or what to do.
 * The guy who set up the wiki for us is no longer with us and now I have to make adjustments although I lack the necessary qualifications. So I need to learn or find someone who could help out. Ideally a bit of both.
 * The reason why the example you had chosen did not work seems to be related to the fact that it uses the Form:New Replication. I thought that since things don't yet work properly I had so far made the changes to Form:New Study lacking replication only. Checking now I see I haven't changed anything in the forms or their templates, only in the Template:Article/replication/entry, which is called by both forms. However, when they worked the categories for the property entries only listed the studies that used the Form:New Study lacking replication.
 * I guess with what you wrote I can already make progress and just have to invest some time that I cannot take right now. I will keep trying. Thank you! ReplicationWiki-fan (talk) 13:02, 4 February 2015 (UTC)
 * Ok, after trying out a couple of things I see that some things work and some others don't and some work but only after some time (I guess that has to do with the job queue). I'm getting closer to a solution because the arrays now worked in the form and also the category with the template for the property listed its entries when I used the syntax like in the template of the form ( articleauthors ) also for the template of the entry ( | ). Why the property is then called Article authors remains unclear to me. One small and quick thing, Felipe, when you wrote I can set the property with  }} , is there a { too much or should the | be replaced by a } ? And where should I set the property? On the property page, in the template of the entry, in the template of the form, or in the form? The whole confusion comes from the use of Authors/Article authors/articleauthors and my failure to understand which means what. ReplicationWiki-fan (talk) 18:51, 6 February 2015 (UTC)

How to define a form for a category but use another on the same category page? (SF 3.0+)
I want to How can I do this? Is there a solution? In former days using special properties, this was possible, now I have no idea to resolve this. Any ideas? Thanks. --Andreas P. 14:46, 27 January 2015 (UTC)
 * 1) edit the category page using one form (e.g "form:category properties")
 * 2) but define on that very page the form to be used for pages gathered in that category
 * on project page    :     would define 1) but
 * on the category page itself overrides of course the global definition


 * Defining forms for category pages has definitely gotten a lot more limited with the #default_form parser function. I thought about that limitation, but figured that very few people use forms for editing category pages. Maybe I was wrong, though! In any case, if all your category pages use the same form, you can make that the default form by putting a #default_form call in the page Project:Category or its equivalent. Yaron Koren (talk) 15:27, 27 January 2015 (UTC)
 * Well, I see (I'm using the setting in Project:Category already). I would like to have that setting possibility back. We use it on Wikis set on our http://biowikifarm.net, e.g. http://wiki.bayernflora.de, http://offene-naturfuehrer.de and some other. I guess it won't change the implementation anew, would it? ;-) --Andreas P. Icon_External_Link_E-Mail.png 15:41, 27 January 2015 (UTC)


 * So - just to clarify - do you have more than one form for editing different category pages? Yaron Koren (talk) 19:01, 27 January 2015 (UTC)


 * So far only one form for editing (all) categories (i.e. form:category properties defined on the project:category page). The category page itself defines another form for *the pages* gathered in that category page. It seems that before SF 3.0 the setting Has default form::… on a category page just defines for the form usage for main namespace-pages, not the category page itself. --Andreas P. Icon_External_Link_E-Mail.png 12:00, 28 January 2015 (UTC)


 * So is there a problem with #default_form? If there's only one form for all category pages, the whole thing should work. Also, the behavior of "Has default form" didn't change in SF 3.0. Yaron Koren (talk) 15:27, 28 January 2015 (UTC)


 * OK "Has default form" still works, although not as translation (e.g. "Hat Standardformular"), but it works as I want it to be: I can use (1) "form:category properties" on the category page and (2) define on the very same category page the form I want to edit all gathered pages. Anyway, with only #default_form it's not possible. Could this functionality (1 + 2) be kept in SF 3.0+ ? I would appreciate it. Or another solution–maybe not clean–would be, to allow a ranking of used forms in #default_form(s). If I understand it correctly, "Has default form" on a category page defines the form for all the *pages* excluding the category page itself, whereas #default_form defines the form to be use for all the *pages* including the category page itself. So it seems, using "Has default form" won't change the rank of old form settings from before SF 3.0. But I'm worried, because it is marked as deprecated and will be removed at some day and Than I have to rewrite all this stuff. Or I should define #default_form only in the template and not on the category page … --Andreas P. Icon_External_Link_E-Mail.png 15:21, 29 January 2015 (UTC)


 * No, #default_form is not supposed to apply to the category page - if it does, that's a bug. Within the #default_form system, the only way to apply a form to a category page is via the Project:Category page. Are you seeing something different? And does that affect your opinions at all? Yaron Koren (talk) 16:56, 29 January 2015 (UTC)


 * «#default_form is not supposed to apply to the category page» but it does (I use SF 3.1 see special:Version on temporary wiki. As described above, my setting is: on (PP) project page Project:Category (BTW: it prints out nothing) and categories work with that form. Good so far. And on a (CP) category page I set  (BTW: it prints: "This category uses the form task", not nothing) and on CP the form:category properties is overruled by form:task. (The Wiki above has German templates and form names, so I translated them) --Andreas P. Icon_External_Link_E-Mail.png 19:50, 29 January 2015 (UTC)


 * Ah, right you are; sorry about that. I just checked in a fix; you can either get the code from Git, or add this change in manually. For the issue of nothing printed out, removing the "Form:" namespace from the #default_form call might help, though I'm not sure. Yaron Koren (talk) 20:31, 29 January 2015 (UTC)


 * Thank you, Yaron. Does it update also with  for "3.1"? My guess is only when using the "2.8.*@dev" version for the package, right? Or I try it manually by implement the patch. --Andreas P. Icon_External_Link_E-Mail.png 21:56, 29 January 2015 (UTC)


 * I have no idea about the Composer stuff. Yaron Koren (talk) 00:02, 30 January 2015 (UTC)

default values depending on dropdown selection
Hello everyone

I am currently facing a challenge with one of my forms. The problem is not entierly new, I know, but maybe it helps to give it some attention every now and then.

What I have is a form with a dropdown (where users can select a type) and a textarea for a detailed description. What I want is to preload a text in this textarea depending on the user selection (preferably without tinkering with js). What makes matters worse is that I have two types where I don’t want to show the textarea at all but store the default text in a hidden input field.

The solution so far is, I have a form that is build dynamically. The form for creating a page works like this:
 * 1) for every type I generate a textare input field with the corresponding default text enclosed in a div with a unique id
 * 2) the dropdown field gets a rather complex 'show on select' statement
 * 3) for the types where I don't want the textarea to be edited, the textarea field gets a restricted statement with a non existing group

Note: In (3) I tried using hidden fields instead but that breaks as soon as someone selects one of these types. Every entry for "description" will then be filled by the last defined hidden type and not the selected one.

This solution kind of works. Ish. To be more precise, the form produces a template call where I have multiple entries for the textarea field all filled with the same (correct) value. Let me give you an example:

The template processing works correct. And the problem rectifies itself with the first edit, because my edit form looks like that:
 * 1) there is only one textarea field
 * 2) there is an edit notice enclosed in a div with a special id. This note states, that the field will be filled automatically by the template
 * 3) the type dropdown has a much more simpler 'show on select': only for the non editable types the edit note from (2) will be shown

So, after I edit the page, the resulting template call looks like that:

Long story short, here are my questions:
 * Is there an easier way?
 * If not, since it is a faily often asked feature: is there any change any future SF versions will support a "value on select" statement for fields?

Used versions:
 * MediaWiki 1.23.5
 * PHP 5.4.35
 * MySQL: 5.5.40
 * Semantic Forms 3.0
 * Semantic MediaWiki 2.0

Tobias Oetterer (talk) 09:01, 28 January 2015 (UTC)


 * Before we get into the details: why not just have a separate form for each type? Yaron Koren (talk) 15:27, 28 January 2015 (UTC)


 * That just happend in the course of development. I generate the fields that differ in the create and edit mask automatically. So basically the form just includes for fields and the template (or more precisely the lua module behind it) decides, whether it should render the "edit fields" or the "create fields".-- Tobias Oetterer (talk) 07:10, 3 February 2015 (UTC)


 * Now I'm even more confused - you have different fields that show up when creating vs. editing a page? Why is that? But as to your first question, I have no plans to add a "value on select" parameter; for what it's worth, I don't remember anyone asking for that feature before. Yaron Koren (talk) 13:55, 3 February 2015 (UTC)

googlemaps field
after hitting submit on a query form. the googlemaps field re-draws but forgets the zoom parameter it had before you hit submit. see:http://juanitospeppers.com/wiki/Special:RunQuery/GlogQuery


 * That's not surprising - there's no easy way for the system to remember what the zoom was. But if you think the default zoom should be different anywhere along the way, I'm curious to hear it. Yaron Koren (talk) 20:32, 2 February 2015 (UTC)


 * shouldn't it find and use the zoom param i have on the form field.


 * No - the map inputs in SF, unlike their counterparts in Semantic Maps, don't support the "zoom" parameter. It's my fault for not explaining that in the documentation. But I set it that way on purpose, because it didn't make sense to me that a certain zoom level would be the best one for one form, or one wiki, but not for another. But perhaps the current defaults could be improved. What do you think? Yaron Koren (talk) 00:07, 3 February 2015 (UTC)

Using {{#set:... with multiple properties
I noticed that a form will not recognize semantic properties that are set in "one go": You need to set them "one by one" like:

Is this behavior correct? I simplified a template and used the the "one go" approach but then the properties that are used in the form "break" in the form. I needed to set those properties used in the form "one by one". I must say that I combined this with  {{#external_value:  but all properties are filled with the  {{#external_value:  call with  {{#autoedit:...  before you can use the form. Regards, --Felipe (talk) 08:57, 4 February 2015 (UTC)


 * It's true that Semantic Forms' template parsing is not perfect. If the form ever doesn't identify the property for a field, the easiest approach is just to hardcode the connection, by adding a "property=" parameter to that field's tag in the form definition. Yaron Koren (talk) 14:09, 4 February 2015 (UTC)


 * Wel it is not a problem. My logic tells me that the "one go" approach is less expensive for the wiki engine but that is probably not true anyway :). I will give "property=" a go in combination with the "one go" approach but in almost all the forms we use the Semantic Forms decides which property it is supposed to use. This works all the time. Thanks --Felipe (talk) 14:26, 4 February 2015 (UTC)

Wrong category/form for subpages created with #forminput
Hello, I try to create location pages and subpages for annual events at these locations. (Location and Location/Event 2015, Location/Event 2016...). For both location and event I have form & template each and in the location template (which produces an infobox) included is the following code for creating an event subpage directly from the location page:
 * Create a new event subpage

I have 2 different categories and on each category page I am using  to define the default form.

But now, when creating the event subpage, it gets automatically sorted into the category of the superpage, thus also using its (wrong) form.

Any ideas what I could be missing? Or could there be a better way of creating the subpages with the prepended location pagename via forms? --Zabien (talk) 01:08, 6 February 2015 (UTC)


 * So you have a "locations" category and an "events" category, but events are showing up in the "locations" category? Do they also show up in the "events" category? Or am I misunderstanding things? Yaron Koren (talk) 03:26, 6 February 2015 (UTC)


 * No, that's exactly what happens. The events only show up in the locations's category, but not in the events category (where they only should be). --Zabien (talk) 11:31, 6 February 2015 (UTC)


 * Could it be that the "event" template just has the wrong category tag? Yaron Koren (talk) 15:32, 6 February 2015 (UTC)


 * This was my first thought, too, but double and triple checked that, it's correct there. --Zabien (talk) 15:45, 6 February 2015 (UTC)


 * Could you pastebin, or include here, the contents of that template? Yaron Koren (talk) 16:33, 6 February 2015 (UTC)


 * Sure: pastebin of "location" template (don't get confused, I simplified the example here). The event template is similar, its last lines:

Open the World map of events.
 * colspan="2" align="center" |
 * colspan="2" align="center" |
 * }

Zabien (talk) 17:18, 6 February 2015 (UTC)


 * I'm still guessing that the issue is in the "event" template (it would have been more helpful if you had pastebin'ed that one), but anyway, this doesn't seem like a Semantic Forms issue - it's an issue of pages somehow being tagged with the wrong category. Yaron Koren (talk) 18:05, 6 February 2015 (UTC)


 * Okay, so I'll have to look further, create new from scratch and see if I can find the troublemaker somewhere in the template. Thank you for your help! --Zabien (talk) 11:41, 9 February 2015 (UTC)

Using Tree input for multiple category selection, doubles up on catebories.
It works. As double ups have no consequence on actual category definition. But it is a pain to have multiple edits also providing multiple entries of the same category.

An example can be seen here.

Is there a way to limit the creation of duplicates, or perhaps a simple method of maintaining such a thing?

As a quick edit to this, there is more of an issue. Removing a category, when one has previously been saved to the page, simply results in it outputting the new categories again, minus the removed one. But the removed one still exists in the list from the previous edit and so it doesn't actually get removed. The only fix I can see in this case is to go into source and remove the duplicates and missing ones that way... There must be a way for the form input to clear out the category and refresh it on save surely? 103.13.11.118 11:53, 9 February 2015 (UTC)


 * That's not good! The issue seems to be that the "Software" category shows up three times in the tree. Is there any way you could simplify your category structure so that "Category:Software" only has one parent? Yaron Koren (talk) 14:32, 9 February 2015 (UTC)

Assign Unique Subobject ID's from Multiple Embeded Form?
I've a great use-case for a multiple instance template that creates subobjects. However it includes the possibility that a subobject with exactly the same property values get entered, meaning the anonymous identifier is also the same, seeing the duplicate object(s) ignored!. Is there a workaround for this? I tried the NumerAlpha extension per this thread but it's output blows up with UNIQ1b9902e25ef3ef0b-in-00000000-QINU stuff under MW 1.23.2 when used in the templates. I can adjust the form to use a ton of statically numbered fields, but the multiple option is so much more elegant when it comes to applying instance-specific mandatory fields, regex filters, and the like. Maybe this is more of a SMW question? Thanks! (SF 3.1) - Lbillett (talk) 19:23, 10 February 2015 (UTC)


 * I can't think of another solution; yes, this does sound like more of an SMW question. Yaron Koren (talk) 21:45, 10 February 2015 (UTC)


 * Ok, thanks. I'll keep it multiple-instance based and just try to cope by communicating the limitations to those using the form. Curious...instead of using a subobject in my template, would a #cargo_store call accomplish pretty much the same thing? Without this duplication limitation? (the template being called multiple times from the same article?). It's not critical the the data be in subobjects and I've been meaning to try Cargo out... heard the author hangs out around here too. - Lbillett (talk) 02:48, 12 February 2015 (UTC)


 * Yes, he does hang around here from time to time. :) That's true, maybe I should have mentioned Cargo - yes, Cargo would work better in this instance, in my opinion. It stores all template calls the same, as just a row in a table, whether there's one or more in a page, and whether the contents of one match the contents of another or not. Yaron Koren (talk) 14:17, 12 February 2015 (UTC)

query string special characters
Hey i tried the url encode and it works better but doesn't really give me what i want. In this case we use pagename = Jon's Grow or

this value loads into a combobox input. ex1 gives me: Jon&amp;#39;s Grow | ex2 gives me: Jon

how do i get the form to translate the url encode into ' ?


 * What version of SF are you using? And did you try this with a link type of "link" or "button" instead? One of those might work better. Yaron Koren (talk) 14:19, 12 February 2015 (UTC)


 * 3.2alpha 2nd feb. just tried with link and button and its the same. tried switching between combobox, text input, both show the &amp;#39;. form here http://juanitospeppers.com/wiki/Form:Glog_Update and formlink on http://juanitospeppers.com/wiki/Template:Glog


 * Okay, thanks. It looks like the issue is with "PAGENAME" itself (though I guess I knew that before). This page offers a workaround, which is to simply wrap the " " call in a call to #titleparts, from the ParserFunctions extension. Yaron Koren (talk) 16:57, 12 February 2015 (UTC)


 * Oh nice, didn't think there would be a bug in magicwords. i changed urlencode and seems to work.


 * Cool. It's not a bug, exactly, just behavior that only makes sense some of the time. Yaron Koren (talk) 17:47, 12 February 2015 (UTC)

Fatal exception of type SMW\InvalidPropertyException - Create Form
I have a fresh SMW / SM-Forms installation:

Product 	Version MediaWiki 	1.24.1 Semantic Forms	3.2-alpha (2255e7c) Semantic MediaWiki 2.1 PHP 	5.6.3 (apache2handler) MySQL 	5.6.21

When I want to use Special:CreateForm.php I get the error:

after I selected a template in the select menu.

Any ideas? Thank you for help Martin 15 Feb 2015


 * Could you add the following to LocalSettings.php:

$wgShowExceptionDetails = true;
 * ...so you can see the full error details? Yaron Koren (talk) 01:46, 16 February 2015 (UTC)

No constraints for autocomplete with remote autocompletion
Just an additional comment to "Autocomplete on Outside Values Doesn't Constrain", posted by Lbillett on 8 December. I haven't tested this in any detail, but in one case I did notice that the issue he/she raised also holds true for "remote autocompletion". Hope that helps if you didn't know already. Cavila (MW 1.22, MySQL 5.5.37-0, Php 5.4.4-14 squeeze, SMW 1.9.2, SF 2.7) 21:59, 18 February 2015 (UTC)