Extension talk:Page Forms

parser function support for values=
Hi Yaron, Just wondering if we could allow parser functions to populate the values= parameter (e.g., #ask, #var, etc.). Currently it does not appear to support it. Perhaps something to add in a new version.

Longphile (talk) 15:20, 2 October 2013 (UTC)


 * It seems to be a regression. Version 2.5.1 works fine ! Impossible to set a default value (as the current date with for example). --195.101.137.127 11:14, 27 October 2013 (UTC)

different forms but same template?
Sorry for a newbie question....

Hopefully I can describe my scenario clearly: 2 different groups of editors are working on the the article. Group A do lots of text and semantics with a form A. That's fine so fare. Group B should add geodata to the articles. Because headertabs and maps don't work together I want to set up a second form B just for the geodata but it should complement the data in template/form A.

should I add in form B ?

Thanks for help.


 * Hi, yes - if you have multiple forms for the same page type, they should contain the same templates - although the set of fields for each can be different, including a template possibly having no fields. Yaron Koren (talk) 14:53, 9 October 2013 (UTC)

How to hide the "additional query" form in query results?
Is it possible to hide the additional query form when displaying the results of a query form? I want only the results to be displayed, not another query form, and haven't found this issue in the documentation here on this site. Thanks in advance! --Daniel5000 (talk) 14:56, 9 October 2013 (UTC)


 * I don't understand - why do you want users to only be able to run a query once, and not change it after seeing the results? Yaron Koren (talk) 02:08, 10 October 2013 (UTC)
 * It is for a query with many steps (about 30 with 3 semantic queries each) in a row, like in a quiz (it's actually not a quiz, so the Quiz extension doesn't help, SF/SMW does it fine). The "additional query" field would confuse the user in this case. It's not the most standard use case for SF, I know, but is there a method to disable this form, perhaps if I touch the code a bit? --Daniel5000 (talk) 03:33, 10 October 2013 (UTC)


 * Ah, okay. I don't think there's any way to do it with the current code, but if you're willing to modify the SF code, it shouldn't be that hard to do. Yaron Koren (talk) 20:13, 10 October 2013 (UTC)


 * I have now figured out how I would have to change the code. But I have discovered a parameter additionalquery=false (in SF_RunQuery.php at line 127 in SF 2.6) which can be passed to the Special:RunQuery page to hide the form. It can be passed via #queryformlink or via the URL string, but then the form disappears before the first query. It seems the parameter must be passed to the result page to hide it there. Is there a way to do this, so I can use the code without modifications? Anyway thank you, if this is a too complex question I now have an idea how to achieve my goal. --Daniel5000 (talk) 23:58, 10 October 2013 (UTC)


 * Oh yes - that's right, that parameter is used to prevent user input entirely. I still think there's no way to do it without modifying the code. Yaron Koren (talk) 18:22, 11 October 2013 (UTC)
 * OK, I will modify the code then. If you are interested in the modifications (it's 5 lines more or so, I thought to resolve it similarly to the "query form on top" parameter) I have no problems to release it here as a patch, but I have no dev access to SF as my PHP knowledge is very rudimentary. Regards, Daniel5000 (talk) 21:18, 11 October 2013 (UTC)

Sure, it would be good to see the patch! Yaron Koren (talk) 19:49, 13 October 2013 (UTC)
 * Here I have described the modifications: User:Daniel5000/SemanticForms-HideAdditionalQuery. (As I hadn't used a stable SF version in my installation, I did't know if a patch file would be really useful, so I did it this way.) Regards --Daniel5000 (talk) 23:39, 22 October 2013 (UTC)

Popup forms in Firefox
I am getting erratic behavior using popup forms in Firefox. Chrome and IE seem to work fine though. I am guessing that the issue lies in SF_popupform.js, as I have played around quite a bit with the CSS to no avail. Basically, in Firefox, the vertical scroll bar is associated with the inner frame (but the outer for other browsers). Horizontal scroll bars are also buggy in FF. Likewise, saving sometimes works and sometimes does not. Can anone confirm strange behavior of popups in FF? In my experience, playing with editing, saving, reloading editing, saving, etc., produces strange behavior at some point, and this behavior is not predictable. I am running the latest alpha version of SF from Git. ~z929669 Talk 04:58, 10 October 2013 (UTC)

Embed Special:RunQuery bugs
I've encountered two bugs when I've embedded a query form into a page. One has already been identified (Bug 49302) and I've downgraded as a workaround. The other is only small but rather annoying. I'm using the date input and for some reason it wraps the dropdown box and the last input box in a  tag. This leaves out the first input box and so the the date input is split into two lines. It doesn't do this on the RunQuery page. You can see the problem here. Can anyone suggest a workaround/fix?--176.251.5.55 12:44, 16 October 2013 (UTC)

Including time for properties with type 'Date'
When specifying a field with property type 'date' the default behavior on Special:CreateForm is to provide 3 x input boxes, one each for day, month and year. Is there a simple way to get the form to include a box or boxes for time as well? I've searched the talk pages back to October 2012 and can't find anything relevant. Likewise the relevant SMW help and talk pages. I am aware of the Inputs extension but would prefer not to have to install it if possible. Thanks in anticipation. --Sabretache (talk) 14:27, 16 October 2013 (UTC)


 * Yes - add "|input type=datetime" to the field tag. Yaron Koren (talk) 16:26, 16 October 2013 (UTC)


 * Thanks Yaron. You're a brick. Much appreciated. --Sabretache (talk) 19:53, 16 October 2013 (UTC)

Another connected item: I cannot get the form to stop populating at least the current month box. I would like all date values to be initially blank but cannot get that to work using default= anything. --Sabretache (talk) 12:02, 17 October 2013 (UTC)

Automatic page naming with #switch
On my wiki we extensively make use of the feature. Today we needed a more complex page naming scheme, where the structure of the page name depended on the value of a field. We tried many things, including this:

However, when we removed newlines it worked:

The example above works, but is very temperamental. If the use of spaces is adjusted it will not work. See the three simplified examples below. Note that none of them have any newlines.

A) WORKS:

B) DOES NOT WORK:

C) WORKS:

So (A) and (C) work, but (B) does not. Anyone have any thoughts as to why this is the case? Thanks in advance!

--Jamesmontalvo3 (talk) 17:56, 16 October 2013 (UTC)


 * To be honest, I'm surprised that any of it works. :) Personally, I never put padding spaces (or newlines) within parser functions like #if or #switch. Yaron Koren (talk) 21:15, 16 October 2013 (UTC)

Popups including result format excel will not properly close
Hi,

using MW 1.21, SMW 1.9 alpha-3, Semantic Result Formats 1.9 alpha and SF 2.6:

I have set a queryformlink to open a query in a popup. The result format is set to excel. If I klick on the download link of the excel, the popup tries to cloas, but is stuck to the loading picture, so I have to reload the whole page to get back to a usable view.

Firebug doesn't show errors apart from TypeError: rules[r].selectorText is undefined of ext.headertabs, which should not be a concern here. I have tested it with FF 24 and Chrome 30, showing the same behaviour.

Is there a way to let the popup close properly (or at least stay open)?

Thanks for the great extension, Yaron!

Regards --92.50.70.114 11:55, 17 October 2013 (UTC)


 * Ah, Javascript collisions between extensions... those can be a tough nut to crack. I hadn't heard of the excel result format, by the way - it looks like it's new in SRF 1.9. Could you try disabling the Header Tabs extension, just to make sure that that's not the cause? Yaron Koren (talk) 14:04, 17 October 2013 (UTC)

Allowed values loaded into form are being changed
I am having an issue with semantic forms where I set a field in the form that contains a list of allowed values set in the property page. One of the values has an underscore character in it. The values are presented in the droplist (or radio button list) but the underscore is converted to a space. If that value is selected the resulting page has an error that the value selected is not in the list of possible values.

This does not happen if you set the list of values in the form with values=, only when pulling the values in from the property page. The form should not modify the values it reads in from the property.

Any ideas?

--Rbonser (talk) 18:47, 18 October 2013 (UTC)

Here is an example property:

Property:Arch This is a property of type Has type::String. The allowed values for this property are: * Allows value::x86 * Allows value::x86_64


 * MediaWiki (Version 1.21.2)
 * Semantic MediaWiki (Version 1.8.0.5)
 * Semantic Forms (Version 2.6)

Property based on Usernames
I'd like to be able to leverage the extremely useful property-search-as-you-enter feature when associating users with text properties. Is there a way to do with without either:
 * 1. Manually maintaining a list of users on a property page
 * 2. Having to create a user page for every user (would enable allows value from namespace). Most of my users don't have/maintain a userpage.

I suppose some way to automatically create some kind of user page for all existing users would do, but I suppose isn't SF related. Thanks! - Lbillett (talk) 13:20, 19 October 2013 (UTC)


 * The only other real option that I know of is to use "values from url", and then to create a web page (in PHP or some such) that accesses the wiki database, or API, to get the set of users, then displays it in the JSON format that "values from url" requires. (The JSON format that "values from url" looks for is unfortunately similar, but not identical, to the JSON format that the user list API query outputs.) If you instead decide to have a user page for each user, you could use the SemanticSignup extension so that, in the future, user pages will get created automatically. Yaron Koren (talk) 00:36, 20 October 2013 (UTC)

Error with Semantic Forms, WikiEditor, and standard input tag
Greetings, I'm running the latest version of Mediawiki (1.22wmf21) and Semantic Forms 2.6. In Internet Explorer 8 I see an odd behavior.

I have a form that ends with the following syntax.

Upon entering a page name and clicking create/edit (two step process) editors are presented with a error in a dialog box. Message from webpage
 * ext.semanticforms.main: [object Error]

WikiEditor then fails to load. Editors can still edit text, but it is hard to discern where the editable text field is as there is no border to the field.

If I remove the tag or "editor=wikieditor" then the error does not appear. However I obviously loose the functionality of either. Also curious is that the tag also does not appear with a label like the "save" or "changes" tag. Instead it is a small labelless button that does not work.

This does not happen in IE 9 and Safari 6/7. While I would love to tell my editors to upgrade to a different browser this is not feasible. In the short term I have removed the preview button. Does anyone have any suggestions?


 * I personally don't think I have the time or resources (i.e., access to IE 8) to look into this issue, but hopefully someone else can. I would suggest adding a "&debug=true" (or "?debug=true") to the URL, by the way, if that's possible - it might lead to a more useful error message. Yaron Koren (talk) 09:08, 25 October 2013 (UTC)

Autocomplete not displaying with Forminput or RunQuery
I'm trying to use the forminput "autocomplete on category=" function, but autocompletion isn't showing anything when typing a value in. When not using remote autocompletion I can see the values being loaded in the script, but no suggestion drop down shows up when typing them in. If I use remote autocompletion, I see the calls to the api for the values, but still no drop down. I have tried setting $sfgAutocompleteOnAllChars to true as well.

Another page with a Special:RunQuery that uses "values from category=" works fine for autocomplete and shows the drop down while typing. The only problem with autocomplete on query forms though, is that it stops matching once you enter a space. So "San Antonio" only matches until you get to "San".

I'm using the newest version of Semantic Forms. Any ideas? Thanks!


 * This may be two different issues. For the autocomplete not working at all, this may be due to the fact that you're using old, deprecated syntax. Instead of "autocomplete on category", you should now use "input type=text with autocomplete" (or "textarea with autocomplete"), plus "values from category". The second one sounds like a bug, though - maybe it's due to the use of sfgAutocompleteOnAllChars? Yaron Koren (talk) 08:55, 25 October 2013 (UTC)


 * Thanks for the reply Yaron. Unfortunately still not working.  The documentation for Linking to Forms shows forminput using "autocomplete on category", and it seems to not process "values from category" if I try to use that instead.  Added "input type=text with autocomplete" in both instances, and no change.  Setting "$sfgAutocompleteOnAllChars = false;" also doesn't fix either problems, and space still stops the autocomplete. I tried seeing if it would match on _, +, or others, but nothing matches the space.  Any other ideas?--66.25.74.224 17:10, 25 October 2013 (UTC)


 * Oops - I misread "forminput" as "form input" - two different things. :) So my advice before was incorrect. I don't know... this isn't a public wiki, is it? The only thing I can think of is that it might be a Javascript issue - check the Javascript console to see if there are any error messages. Yaron Koren (talk) 08:20, 27 October 2013 (UTC)


 * No problem Yaron :). So this is what I've figured out so far.  On the #forminput api request, it's using "api.php?action=sfautocomplete&format=json&undefined=input_1&substr=", and so category wasn't defined as the property, and input_1 is set for autocompletesettings.  This is using "autocomplete on category=States".  I'll play around with #forminput, and see if I can get it to act correctly, but I'm sure you have a much better idea of what's happening than I do.
 * On the space matching issue, it matches fine when autocompleting a category, so something like "category=State&substr=New+York" matches "New York" just fine. When using properties though, "property=State&substr=New+York" doesn't match, but "property=State&substr=New York" does match.  Any ideas how to fix this one?--66.25.74.224 16:26, 27 October 2013 (UTC)


 * Given that this (I assume) isn't a public wiki, could you try to replicate this bug on http://scratchpad.referata.com? It could be that it's something specific in your data structure that's causing the problem. Yaron Koren (talk) 22:52, 28 October 2013 (UTC)

Show on select not filled?
According to Extension_talk:Semantic_Forms/Archive_January_to_February_2013 I try to work around editing my Fields by showing them with a Show-on-select-Combobox and let the parts fade in and out. This works fine so far, causing me to the problem that only the shown fields are saved. All other fields hided by selection will be emty. I assume there is no reason to save fields, witch are hidden in a normal form, because information filled in befor seems not to be needed if the user select another option. In my case - ofcause a workaround - it would be usefull - any solutions? --Letofred (talk) 07:50, 25 October 2013 (UTC)


 * Hm - if the goal is just to hide complexity, maybe it would work better to use collapsible elements instead? Yaron Koren (talk) 08:58, 25 October 2013 (UTC)


 * Leading me to the old Problem, the multiple parts have to apear in front of normal fields --Letofred (talk) 10:52, 25 October 2013 (UTC)


 * Sorry, I don't understand. Yaron Koren (talk) 14:35, 25 October 2013 (UTC)

Display multiple instances in tabs
Hi Yaron, it`s great to work with your extensions. It enables a non-programmer like me to create great solutions. :) I have got a question concerning the headertabs in semantic forms. I would like to display multiple instances in tabs - not in the form but in the template. But when I put the syntax for the headertabs in the template it seems like the headertabs are ignored and the heading is displayed as h1. Is it even possible to do this? Thanks in advance! Dadai12 11:39, 29 October 2013 (UTC)


 * That's great! Hm, that seems like it should work... two questions: do the tabs work when you put the headers directly into the page? And do they work when you put headers into a standard, non-multiple-instance template? Yaron Koren (talk) 12:43, 29 October 2013 (UTC)


 * Thanks for your quick reply. Yes, the tabs are working when I put the headers directly into the page and also when I put them in a non-multiple-instance template. That`s what my template looks like - maybe I did something wrong:

=Gültig ab Version Has version::=

Dadai12 12:57, 29 October 2013 (UTC)


 * Okay, cool. My guess is that it's the SMW tag within the header that's causing the problem - but perhaps I can solve two problems in one here, and recommend that, instead of direct SMW tags, you should use either #subobject or (from the Semantic Internal Objects extension, #set_internal, to store the data - it's ideal for arrays of data like this one. Yaron Koren (talk) 13:54, 29 October 2013 (UTC)


 * Okay, thanks for the tip. That`s new for me - I will look into it. Thanks for your help so far. :) Dadai12 14:20, 29 October 2013 (UTC)

Saving Partial Forms with SF 2.6
I noticed this back with 2.5.3 and hoped that it would be fixed with this latest version. Whenever I try to save a page based upon a partial form, it does not save any of the changes. Everything else works as normal.

My code:


 * Partial forms haven't been fully working in a long time, and my hope is to actually get rid of them eventually. Instead of partial forms, I would recommend, if possible, to make this a "quasi-partial" form - a form that includes the other template or templates from the main form, but simply doesn't include any of their fields, if that makes sense. Yaron Koren (talk) 16:40, 1 November 2013 (UTC)


 * Do you have a sample?


 * Hm, I can't think of one. But the idea is just to have one or more pairs of "" and "" tags, with nothing in between, if that makes more sense. Yaron Koren (talk) 20:03, 1 November 2013 (UTC)

Installation won't work
Hello, I am having a very strange problem, and I seem to be the only one: The installation steps have been done - but the special pages & extension in "version" just won't show up. I work on MediaWiki 1.21.2, have installed Semantic MediaWiki 1.8.0.5 and then downloaded and installed the latest version of Semantic Forms. In the localSettings.php I have included the desired line as stated below Semantic MediaWiki etc etc. Everything was done like stated, but. Any hints what I could have been missing/what could be wrong? (I hope this is the right place to ask, if not, please point me somewhere else.) There is set another namespace (500, 501) so I wrote $smwgNamespaceIndex = 100; in the Localsettings. --Zabien (talk) 02:19, 2 November 2013 (UTC)


 * Is it only SF that's not showing up, or also SMW? Yaron Koren (talk) 13:04, 3 November 2013 (UTC)