Extension talk:Page Forms/Archive August to September 2013

namespace showing up on values from category

I maintain a closed wiki within our company, thus i cant give any access to the real pages. I have some fields that are supposed to hold the users login name e.g. Brownc for Charles Brown. All the users have their own semantic userpage where organisational data (phone, room, building, etc) is stored. The users can create subpages to their userpage to test/implement/store information that is mostly for themselves.
Now i want to use all those real userpages to autocomplete on the users loginname. The Userpages are categorized as Category:Userpage. I did an autocomplete on the category:

{{{field|userlogin|size=50|autocomplete on category=Userpage}}}

Now, as autocomplete starts, it prepends a "User:" to the loginnames. I would want to have something in the input field like "Brownc" and get "User:Brownc". Can the namespace that is prepended somehow be suppressed? I dont need it in my property either. Regards Ciannicay (talk) 14:48, 2 August 2013 (UTC)

You could try "autocomplete on namespace=User" instead. Yaron Koren (talk) 15:11, 2 August 2013 (UTC)
This would lead to vast numbers of pages showing up in autocomplete that are in no way userpages. To explain it a little more: Our users have to fill out a form that generates a "homepage" for the user. But what the user does below (using subpages) his userpage (=his homepage) is completely up to him/her. We do have users that made 120 pages below their userpage just for themself. These pages would all show up in autocomplete, and thats unwanted. We did an upgrade leap from Mediawiki 1.12.0 (SF 1.3.6) to Mediawiki 1.17.5 (SF 2.2.1) recently. I am trying to get back some old behaviour cause we cannot upgrade our other tools in near future. Ciannicay (talk) 10:32, 6 August 2013 (UTC)
Hi - actually, I believe namespace autocompletion is "smart" and doesn't include subpages, although I don't know if that was the case in the SF version you're using. In any case, if you're using forms, and thus templates, there's a simpler option: to the main template being used for user pages, add something like "[[Has username::{{PAGENAME}}]]". "Has username" should be a String property, and then you should add "|values from property=Has username" to the original form field tag. Yaron Koren (talk) 15:53, 6 August 2013 (UTC)
You made my day. I already set exactly the property you used as example. *facepalm* I was missing the forest through the trees. Your solution works like a charm. Thanks a lot. And keep up your great work! Ciannicay (talk) 14:37, 7 August 2013 (UTC)

Bug? When creating a page through a form in IE the preview button disappears.

Hi,

I have a wiki that can launch a form with the following code:

{{#forminput:form=Step-by-Step|size=50|default value=|button text=Create a Step-by-Step Page|query string=|query string parameters|autocomplete on category=|autocomplete on namespace=|remote autocompletion|placeholder=Enter the name of the Step-by-Step page}}

When I create an article with chrome using this process everything is fine, but IE loses the show preview button. I would appreciate any thoughts.

Is this related to #forminput? Or does the same issue happen if you just go directly to the form URL? Yaron Koren (talk) 15:04, 7 August 2013 (UTC)


This happens when I go to the form directly as well 17:31, 7 August 2013 (GMT)

Page name formulas

I would like the user to enter a value in the page name text box, the one on the creation page, but then change the name they chose. For example they should be able to enter an incident number like "12345" and I would like to force the resulting page to have the name "Incident_12345". How can I accomplish this? Thanks, Pete.

You can't do that - you would have to go through the one-step process to change the entered name in any way. Yaron Koren (talk) 14:20, 8 August 2013 (UTC)

Bug: Uploading files doesn't work with Internet Explorer (v9), can anyone un-/confirm this as a bug?

Bug: Uploading files doesn't work with Internet Explorer (v9), can anyone un-/confirm this as a bug?


Steps to reproduce the problem:

  1. Create a form with a file upload field.
  2. Create a new page from the form
  3. Click "upload file" on the upload field, a javascript modal panel will appear.
  4. Upload a file and submit.


The expected behavior:

The modal panel closes, setting the filename in the file-upload text field.

The actual behavior:

Modal panel never closes and goes blank (only white background showing). Closing the modal panel with X icon, closes it, but underlaying form is broken. Text is not set in the file-upload text field.

What versions of MediaWiki and Semantic Forms are you using? Yaron Koren (talk) 13:06, 21 August 2013 (UTC)
MediaWiki-1.19.7, PHP-5.4.4, Semantic Forms-2.5.3 --netbrain (talk) 16:00, 21 August 2013 (UTC)
Okay. Unfortunately I only have IE 10, and I just tried it with that version and it's working fine for me. I'll try to find IE 9 somewhere. What operating system are you on, by the way? (I assume it's Windows something.) Yaron Koren (talk) 20:56, 21 August 2013 (UTC)

Need for an Append Form to add instances (multiple template) to a page only

Forms are well-suited to add/edit/delete/sort instances of a multiple template included on a page. However if the number of instances gets significant (e.g. above 200) the time to open the form increases dramatically. This is quite annoying when you ONLY wish to add/append an instance (no need to see existing instances). Is it possible to create a form that can only append/add new instances for a multiple template (without having to process existing instances)?

To give you an example. We use semantic mediawiki to manage the metadata of our measurement system that consistent of many locaties (stations) with deployed instruments. For these locations or stations many pictures, documents, historical scanned material etc is available that is added as internal objects containing a timestamp/file reference and a description field. If someone wishes to add an additional document is takes very long to open the form because all existing attachements (internal objects) have to be processed and displayed first. This hampers the contribution of information!

Thanks in advance.

Jan Willem

Unfortunately, no... I can't think of a solution to this problem given the current software, other than to (a) just tell people to use the regular edit page, instead of the form, or (b) change the data structure so that each location/station has its own page. Yaron Koren (talk) 18:07, 21 August 2013 (UTC)
Thanks for your prompt response. FYI:there are pages for each station/location. I might go for option (b) which implies that each page attachment gets its own page....Jan Willem Noteboom (talk) 6:46, 22 August 2013 (UTC)
Oh, oops, I misread what you wrote. Right, pages for each attachment... if those are already stored as an uploaded file (in the "File:" namespace), you could in theory put the semantic data (and form) directly on that File: page, instead of creating a new page - people have done it both ways. Yaron Koren (talk) 13:00, 22 August 2013 (UTC)
Thanks for your suggestion. Perhaps the extension UploadWizard meets our needs. it offers the ability to add information templates...Jan Willem Noteboom (talk) 19:46, 22 August 2013 (UTC)

Hi Yaron,

thanks for your fabulous work!

We are using Semantic Bundle 1.8.0.4 on MW 1.21. I am passing values to a template creating properties as follows:

<includeonly>{{#set:Tag={{{LABEL|}}} }}</includeonly>

Definition of Property:Tag:

[[has type::Page]]
[[Creates pages with form::Tagsnip]]

Still it does not populate red links automatically, which it reliably does for other pages with [[Tag::Value]]. When I change the template accordingly, all works well.

Is this a bug?

Regards

--92.50.70.114 07:28, 22 August 2013 (UTC)

I doubt that the fact that the properties are being set via a template per se has anything to do with it - by the time they're queried by SF, they look the same regardless of how they were set. If you look in the "Browse properties" link in the sidebar for a page that uses the template, is "Tag" being stored correctly? Yaron Koren (talk) 13:06, 22 August 2013 (UTC)
I tried tho above on our test Wiki (MW-1.22wmf12, SMW-1.9 alpha) and it works just fine. Are you sure you created the following pages:
  • [[Property:Tag]] with:
[[has type::Page]][[Creates pages with form::Tagsnip]]
  • [[Template:Tagsnip]] with:
<includeonly>{{#set:Tag={{{LABEL|}}} }}</includeonly>
  • [[Form:Tagsnip]] with:
<includeonly>{{{for template|Tagsnip}}}
{| class="formtable"
! LABEL:
| {{{field|LABEL}}}
|}
{{{end template}}}</includeonly>
  • A random page with:
[[Tag::Blabla1]][[Tag::Blabla2]][[Tag::Blabla3]][[Tag::Blabla4]][[Tag::Blabla5]][[Tag::Blabla6]]
The page names (assigned to the properties) should then be added to the job queue. Depending on how long the queue is it might take a while for the pages to actually be created. If your Wiki is not busy just keep hitting ctrl-F5 and you will see that the page links will miraculously turn from red to blue. Hope this helps. Regards --Jongfeli (talk) 13:43, 22 August 2013 (UTC)
Hi Yaron and Jongfelli,
Yes, the properties showed up in Browser Properties as expected, apart from staying red. Jongfeli, I started runJobs.php multiple times to force the page creation - without success. I used the tags in other templates as well without using set, it always worked well.
Still, it is no problem for me to use [[Tag::Value]], so I don't think I will be able to spend more time on it. I will update the wiki after the stable release of 1.9 and might check for it then. Thanks for your assistance anyway!

Fatal error when creating article from linked form.

Similar to this previous discussion, I'm getting a fatal error when attempting to submit an article from a linked form (MW 1.21.1, SMW 1.8.0.5, SF 2.5-2.5.3). The error varies depending on which version of SF I'm using.

SF 2.5: PHP Fatal error: Call to a member function exists() on a non-object in /<snip>/extensions/SemanticForms/specials/SF_FormEdit.php on line 273

SF 2.5.3: PHP Fatal error: Call to a member function getArticleID() on a non-object in /<snip>/extensions/SemanticForms/includes/SF_AutoeditAPI.php on line 687

The referring URL is of the form: http://example.com/wiki/Special:FormEdit/Article/?Article%5BHas+Title%5D=Something

The form includes a statement, at the top: {{{info|page name=<Article[Has Title]><count> <unique number;start=1>}}}, which appears to make no difference.

If the form is provided with an article name, e.g. http://example.com/wiki/Special:FormEdit/Article/Foo?Article%5BHas+Title%5D=Something, the submission will succeed and the article will be created.

Normally, I'd assume that I'd just done something stupid and I'd find a workaround. However, I had a wiki last year or so that I could swear had this exact type of bookmark, and I didn't encounter any errors with it.

Thoughts?

16:28, 22 August 2013 (UTC)
The "<count>" in the "page name" value looks suspicious... could that be the source of the error? Although, as F.trott pointed out in his response, a crash like that is never the right behavior. Yaron Koren (talk)
Sorry Yaron, that was a typo on my part. It's not present in my markup for the affected form.
I'm really puzzled by this because I swiped the code from Jamie Thingelstad back in the day. I checked and his bookmarklet still has the same sort of URL, and he's running bleeding-edge everything on that wiki. I'd expect him to be seeing the same bug, but it doesn't appear that he is.
23:01, 22 August 2013 (UTC)
Could you reproduce this on a public wiki, like http://scratchpad.referata.com? Yaron Koren (talk) 00:15, 23 August 2013 (UTC)

Sure, except it seems to work there :-/

Consider the form: http://scratchpad.referata.com/wiki/Form:Bug_Demonstration
Editing with a provided title: http://scratchpad.referata.com/wiki/Special:FormEdit/Bug_Demonstration/Whee
Results in a valid article: http://scratchpad.referata.com/wiki/Whee
A URL opening the page without a provided title but with the field used to create the article populated: http://scratchpad.referata.com/wiki/Special:FormEdit/Bug_Demonstration/?Demonstration%5BTitle%5D=Wheeee
Results in a valid article: http://scratchpad.referata.com/wiki/Wheeee

Maybe I'm cracking up, Yaron. I guess I'll report back if I figure out what's going on.

The only thing I can think of is that I keep my form templates in a special namespace, Stencil. So instead of calling {{Article|Title}}, I'm calling {{Stencil:Article|Title}}. There isn't a problem elsewhere, AFAICT: my URLs for populating the fields work correctly (&Stencil:Article%5BTitle%5D=<snip>), my other scripts (I'm using F. Trott's dynamic defaults javascript, for example) work correctly, etc. So far as I can tell, everything works correctly except that the title object doesn't seem to be constructed when the form is submitted.

14:12, 23 August 2013 (UTC)

Issue with partial forms

I'm having an issue with partial forms using Semantic Forms 2.5.3. Whenever I edit a page through Special:FormEdit/ThePartialForm/ThePage only new parameter-value pairs are added to the template on the page. Any existing values that are changed through the form are never updated. When the partial form uses a multi-instance template, not even new values are added and the page is never changed at all.

You can verify this behaviour here (on the example page that the SF partial forms documentation links to). Just change some of the items and/or add another and then choose 'show changes'. The result will be empty, i.e., no changes are being seen.

I've been poking around a bit in the code of SF_AutoeditAPI.php, and found that around l.830, after executing

// and merge/overwrite it with the new data 
$this->mOptions = SFUtils::array_merge_recursive_distinct( $data, $this->mOptions );

the variable $this->mOptions contains the right values, however the correct contents of $this->mOptions appear not to be transfered to the $targetContent variable, which is used to edit the page around l.900:

$editor = $this->setupEditPage( $targetContent );

I am stuck here, since I'm unsure how $this->mOptions and $targetContent are supposed to be related. Can anyone with a better grasp of the SF code design and its inner workings help me solve this issue?

--Remco de Boer 09:12, 26 August 2013 (UTC)

Hi! Same here. Did you find a solution? Thx! --Drhirn (talk) 08:17, 5 September 2013 (UTC)

Defining relationships in templates and being able to query on those relationships.

Is it possible to define a form with multiple-instance where i then can use a ask query to fetch properties from the multiple-instance form/template?

Example: Say i have a form Book and a subform/multiple instance Author, where one book may have many authors.

How would i go about setting this up? and how can i create an ask query to fetch me basic data about the book aswell as the names of each author?

You need to use either the #subobject parser function, or #set_internal from the Semantic Internal Objects extension, within that multiple-instance template, in order to store the data. I hope that helps... Yaron Koren (talk) 13:35, 26 August 2013 (UTC)

Minor edit not marked as such when using a free text field

Hi Yaron, I really like your extension a lot. It helps me do some great thinks for our wiki. :-) Now I'm not sure if I found a little bug. I use a "free text" field in my form. But then the minor edits are no longer marked as minor. Without the free text it works as planned. I'm I using it wrong or is there a work around? Thanks! - Dadai12 (talk) 14:38, 26 August 2013 (UTC)

Hi - this was a bug in SF 2.5.2, but I thought it was fixed in 2.5.3. What version are you using? Yaron Koren (talk) 13:33, 26 August 2013 (UTC)
Hi, thanks for the quick reply. Great to hear - I'm currently using 2.5.2. Sorry, I haven't seen there was a new version. I will update tomorrow and let you know about it. :-) - Dadai12 (talk) 15:44, 26 August 2013 (UTC)
Good morning - I did the update today and now it works perfectly again - thanks! - Dadai12 (talk) 9:04, 27 August 2013 (UTC)
The same goes for the parameter preload, isn't it? It does not preload my page in the free text input area. Does the 2.5.3 resolve the problem? Silkwood (talk) 09:46, 30 August 2013 (UTC)
OK! Tested. It works. Silkwood (talk) 09:56, 30 August 2013 (UTC)

Problem with Autogrow Parameters

Hi,

First of all, This is an EXCELLENT EXTENSION! and I love it 100%!!

However, I just noticed that there is a problem when adding the Autogrow Parameters to textarea. Not sure if its a bug or if its reported somewhere before. Anyhow, what happens is when the autogrow parameter is added to the text area, the textarea's min width becomes too long in lower resolution screens. Meaning, the width is too long that it goes beyond the borders of its parent div in lower resolutions. I noticed this because for my site I have a minimum width of 650px for the bodycontent section excluding the sidebar. So when the screen is reduced to 650px wide for bodycontent, the textarea doesnt resize and the width overlaps over the sidebar on the right. This is not noticeable in higher resolution screens. When I remove the "autogrow" parameter, the width of the textarea resizes properly for smaller screens. Unfortunately without the autogrow parameter it doesnt increase in height and shows an ugly scrollbar but with autogrow it looks even worse with the textarea going outside its body area in smaller resolutions. Can this be fixed? How can I fix this?

That's great to hear! You can change the width manually by adding "|cols=", and also by adding "|class=" and then setting the width via CSS, for whatever class name you chose. If neither of those solve this problem, I hope you still love it at least 90%. :) Yaron Koren (talk) 12:55, 1 September 2013 (UTC)
Hi Yaron, I tried adding col, but it becomes a fixed width in that case which looks fine in small resolution screen but looks too small on high resolution screens. When I tried adding a class to it and then added a width in percentage like say width=90% for that class, then its still the same problem. The width is too big in small resolution and goes outside the border and doesnt respect the 90% width condition. So for now I have removed the autogrow parameter and increased the height by adding rows to it. Atleast the default height in this case is a bit bigger but still shows the scroll bar when it has more contents inside it. Do you know what may be causing this? Could this be fixed in the future version? Other than that, I am still loving it.
I have another question on these forms regarding the minimum and maximum instances and I have added a separate topic for that below since its a different question. Cheers!

Special:CreateClass SF 2.5.3 broken in the latest "master" combo ?

Hello,

I filed a bug report about Special:CreateClass and Special:CreateForm.

[Wed Aug 28 12:12:57 2013] [error] [client 129.194.30.22] PHP Fatal error: 
Cannot use object of type SFTemplateInForm as array in
/export/data/portails/mediawiki/extensions/SemanticForms/includes/SF_Form.php
on line 100, referer: http://edutechwiki.unige.ch/en/Special:CreateClass

[Wed Aug 28 12:38:33 2013] [error] [client 129.194.30.22] PHP Fatal error: 
Call to a member function getDBkey() on a non-object in
/export/data/portails/mediawiki/extensions/SemanticMediaWiki/includes/BasePropertyAnnotator.php
on line 106, referer: http://edutechwiki.unige.ch/en/Special:CreateForm

This bug appears only in combination with the latest MW/SMW and other SMW code in the "master" branch. Special:CreateClass for SF 2.5.3 does work on scratchpad.referata

I hope that this is a bug and not some systematic misconfiguration. That being said, I could replicate this in another (independent) wiki on the same machine and in another wiki that sits in a different machine. It's not a showstopper bug, since I could create the forms and properties manually, e.g. I did this after the bug started appearing. Sorry for not knowing, but I have no clue after which upgrade of what extension the bug crept in. I was trying to get semantic maps going and didn't create any form while switching to the latest master code. To summarize, if you "git pull" the latest code of MW, SMW and other needed extensions from master branch, then it seems to be broken

Versions:

MediaWiki 1.22alpha (f857f0c) 08:46, 25 August 2013
PHP 	5.3.10-1ubuntu3.7 (apache2handler)
MySQL 	5.5.32-0ubuntu0.12.04.1
Semantic MediaWiki (Version 1.9 alpha-2)

Accessible wikis for details:

Update

This bug has been fixed last week, pull a new copy from the GIT archive. Also make sure that you got enough Shell memory

$wgMaxShellMemory = 512000; // or more of course, i.e. I got 5000000. Anyhow the 100K default value is too little

- Daniel K. Schneider (talk) 15:23, 9 September 2013 (UTC)

Extension:Semantic Forms/Creating query forms

Exampeles in Extension:Semantic Forms/Creating query forms do not work

Fatal error: Call to a member function replace() on a non-object in /home/ngrandy/public_html/w/includes/parser/Parser.php on line 4991

-- 87.177.139.177 07:18, 1 September 2013 (UTC) 

Thanks for letting me know - I just fixed the problem. Yaron Koren (talk) 12:50, 1 September 2013 (UTC)

Fatal error: Class 'ParserHook' not found in SemanticMediaWiki\includes\parserhooks\SMW_SMWDoc.php on line 15

Although this extension works fine, when I run the update.php by going to mysite.com/wiki/mw-config/, I am getting the following error:

Fatal error: Class 'ParserHook' not found in localhost\wiki\extensions\SemanticMediaWiki\includes\parserhooks\SMW_SMWDoc.php on line 15

I recently had to run a database update when I was installing another extension (actually it was another awesome extension written by you: Approved Revs) and thats when I noticed this error. Once this error shows up, I was unable to access any wiki pages. So I had to comment the Semantic Extension in my LocalSettings.php, run the database update (which works once the Semantic extension was commented) and then added the Semantic Extension to my Localsettings.php once again after its done. Do you know what may have cause this issue? I am using Mediawiki 1.21.

Cheers!

That sounds like a Semantic MediaWiki issue, not a Semantic Forms issue. Yaron Koren (talk) 21:43, 1 September 2013 (UTC)

Fatal error: Call to a member function getNamespace() ...

Trying to create a class using the 'CreateClass' form fails with the error

   Fatal error: Call to a member function getNamespace() on a non-object in /var/lib/mediawiki/includes/job/JobQueue.php on line 353

There were also warnings from SemanticTasks, but these disappeared after I disabled that extension.

My config:

  • Semantic Bundle (Version 1.8.0.4)
  • Semantic Forms (Version 2.5.2)
  • MW 1.19.2

I'm happy to provide any other details required to troubleshoot the issue.

Girlwithglasses (talk) 21:25, 3 September 2013 (UTC)

This may or may not have been fixed in SF 2.5.3 - we're well overdue for releasing another Semantic Bundle. If you can upgrade 2.5.3, please try doing that. Yaron Koren (talk) 01:45, 4 September 2013 (UTC)
Confirmed as fixed in 2.5.3. Thanks! Girlwithglasses (talk) 21:47, 5 September 2013 (UTC)
That's great news! Yaron Koren (talk) 02:19, 6 September 2013 (UTC)

Maximum and Minimum Instances

Hi Yaron, I have added a maximum instances of 3 for some fields but what happens is even when the max 3 instances are added, it still shows the "Add More" button. So if a user adds say 4 to it, it allows it but later shows an error saying it has exceeded the maximum instances only when previewing or saving the page. So I am wondering if there is a way to hide the "Add More" button once the maximum instances are reached? Similarly if I add 1 as the minimum instances, is it possible to open the form with the minimum 1 instance already added to the form first rather than clicking on the Add More button with 0 instance opened as default?

Neither of those are currently possible, but they're both good ideas. Yaron Koren (talk) 14:35, 4 September 2013 (UTC)

Fully Confused About Checkbox Fields....Not sure how to use them

Hi Yaron,

I have been trying to use checkboxes on my form and I've been banging my head whole night and couldnt get my head around how it works. I think the checkboxes in these forms works different from what I thought it would. I will try and explain with an example so you can understand what I am trying to do so hopefully you can give me some suggestions and how I can do it.

The reason why I am trying to use a checkbox and not a drop down or combo box is because I am trying to list a few items that users can check and in the end only show the items that are checked. For example, lets say each of these are checkboxes:

X Fruits

 x Apples
 x Oranges
 x Pear

X Vegetables

 x Potato
 x Carrot
 x Tomato

etc...

So if a user checks on Fruits, using the show on select, I want to show the list of fruits that they can further tick on what they want using the checkbox. The same with vegetables, etc.. In the end, when the form is submitted, I only want to show the selected items that was checked and nothing else. These are the troubles I am facing:

1) When I tried checkbox input type, it doesnt let me have a value (or label) to list next to it. I think a checkbox value is like yes or no type and not like listing names like Apples, Oranges, etc.. How do I do that? 2) If I have the checkbox property as Boolean and when its checked, it shows 'yes' or 'no' as its value in the end. How can I show apples, oranges, etc.. when the checkbox is checked and not Yes or No? 3) Do I need to maybe add something in the template to show a value only when the checkbox is selected?

No idea how to use it. Have I completely misunderstood the use of checkboxes in Semantic Forms? Is there a working sample I can have a look at? Thank you Yaron!

I don't think showonselect can reveal the <div> you want inside the checklist. However you could do something like:
 {{{field|FruitVeg|list|show on select=Fruit=>Fruit;Vegetable=>Vegetable;}}}
 <div id="Vegetable">
 {|
 |{{{field|Vegetables}}}
 |}
 </div>
 <div id="Fruit">
 {|
 |{{{field|Fruits}}}
 |}
 </div>
This would reveal the fields for Property:Vegetables and Property:Fruits depending on what you picked. At least, that's how mine work. - Lbillett (talk) 21:02, 4 September 2013 (UTC)
Thank you Lbillett.... I had a look at your suggested idea in the sample given for the 'show on select' option in Semantic Form guide. It does work but to achieve what I am after its making it a little complicated to something that can rather be simple. For instance, I want the user to have the ability to select multiple options from the list. The listbox does allow selecting multiple options but when viewing as a user who has very limited technical knowledge, they wont be able to figure out that they need to press control to select multiple options. A lot of the users on my site knows only very basic browsing and expects a very user friendly GUI and a simple thing like pressing ctrl to select multiple options might seem too complicated for them. I am thinking in terms of layman's view based on the FAQs I usually answer to my users where most of them are very basic. So for instance, if I tried your suggested method and if dont use the listbox option, the only alternative is to use a drop down list where I have to create separate templates for each section and then have an option of adding multiple instances. In this method I need to do something like this, create Template 1 for main headings like Vegetables, Fruits, etc.. that allows multiple instances if you want to add more than 1 options. And then create other templates individually for the list of vegetables, list of fruits, etc.. have them as drop down list that allows users to select 1 at a time and then add multiple instances for these templates for adding more. In this method I would need to end up creating many templates for it. So the only option to simplify this I thought would be having like a checkbox next to each selection to easily select the ones they want rather than adding more instances and adding the drop down list one at a time or them trying to figure out how to select multiple option with a listbox. This will be more useful but I dont think its possible like that, is it? I also tried this with the checkbox option but didint work:
(1) I created properties for each of the lists, like Vegetables, carrots, etc.. I set it to String type so I can enter a predefined values like Vegetables, Fruits, carrots, etc.. for each property.
(2) I then added these to the templates like this: [[Vegetables::{{{Vegetables|}}}]], etc....
(3) I added this to the form: | {{{field|Vegetables|input type=checkbox}}}
(4) When I fill in that form and preview it, I thought when the checkbox is clicked it will show the predefined property value that is stored when creating the property as string but it shows this error instead: "Yes is not in the list of possible values (Vegetables) for this property".
(5) Since it is showing that error when its type String, I tried changing it to Boolean instead. But I cant set predefined values for Boolean like you can do for String type in the properties. When I set these as boolean, when selected it only shows as 'Yes', but I want it to show a value in the submitted form instead.
So I am stumped! So based on your response I guess my only option will be to use the listbox option. I also tried using the two listbox extension but its not working properly and also I am unable to customize the box when each value has really long text. I find a simple task like this overly complicated. :(
Actually after a bit more searching, I found a sample that shows checkboxes. This was hugely helpful in giving me an idea on how to use them. Here is the link: http://smw.referata.com/wiki/AWESOME I think the reason it wasnt maybe working for me could be I didint add the arraymap for this set of checboxes in my template and hence the form that was created based on this template didnt pick up on it. I will give it a try now.
It could be just that you're using the wrong input type - there are two input types, "checkbox" and "checkboxes", and "checkboxes" is the one you need. Though you do also need an #arraymap call in the template. Yaron Koren (talk) 13:08, 5 September 2013 (UTC)
Hi Yaron & Lbillett, I finally got it to work and it works perfect like I wanted. This is what I did:
1) I used the drop down for the main headings like Vegetables, Fruits, etc.. similar to what Lbillett suggested above and then used the Show on select to display the checkbox that lists the list of vegetables or fruits when they are selected. Lbillett input was useful here since like he said I cannot use checkbox for everything as it is not possible to use showonselect to reveal the <div> I want inside the checklist. So having a drop down for the main heading make sense.
2) I then created properties of type string that has pre-defined values with the list of vegetables, list of fruits, etc..
3) I created a template and I called these fields with an arraymap like: {{#arraymap:|,|x|Has blah::x}}
4) I then created the form with the input type as Checkboxes (like Yaron suggested)
5) Lastly I tweaked the showonselect parameter for the drop-down list to show the respective checkboxes when an item is selected.
This worked really well. I just needed to add multiple instances to that template so user can add more to it by clicking on that button.
Thank you both so much. Both of your input helped me out a lot in getting an understanding on how I can go about creating this using checkboxes. I was stuck on this for 4 days since I misunderstood the concept. Now I get it. Without your help, it would have taken me 10 days. So thanks heaps... I am very happy :)
Glad it worked out for you. The example I wrote DOES generate checkboxes for me (for FruitVeg), though I had no idea it was because I was using #arraymap in the template! Guess I learned something too. - Lbillett (talk) 01:43, 7 September 2013 (UTC)

Autoedit with a current time argument

Hello, I'm trying to set a date property on a button click using the autoedit function (is it ever useful!). Problem is I want the date/time that coincides with submission of the form/article save, but when you define an autoedit element like:

{{#autoedit:form=MyForm|target=TargetPage|link type=button|link text=Click Here|query string=TEMPLATE[Click Date]={{#timel:Y-m-d H:i:s}}|reload}}

The date/time passed is the one generated on the loading of the article that has the button, not on submission of the form (if that makes sense). I've tried doing it on the form side, but I'm refreshing a date argument/property that already exists (default=now only lets me put a date time in for an unset property).

Ideas? - Lbillett (talk) 20:51, 4 September 2013 (UTC)

That's a tricky one... there may not be a way to do that. Though perhaps what you really want is the date/time the new page was created - if so, there may just be a way of extracting that from the wiki database, instead of having to store the information on the page. Yaron Koren (talk) 13:14, 5 September 2013 (UTC)
Thing is, I'm trying to set (or reset) a property on an existing article, any time the button is pressed... I wonder now, maybe I could break it down into a couple steps. One button to clear the property, the next could use a different form with default=now to set the property during page save. A little less elegant, but might do the trick. - Lbillett (talk) 01:44, 7 September 2013 (UTC)

"Page has default form" not working in custom namespace

Hello ! I can't make the special property [[Page has default form::form-name]] to work. Based on the category, [[Has default form::form-name]] works fine , but when I want to declare a form when a specific template is called, I do not get the tab "Edit with form".
I am currently working with MediaWiki 1.21.1, Semantic 1.8.0.5, Validator 1.0 alpha (I need that release for the maps extension), SemanticForms 2.5.3. Could it be a compatibility problem ?
Thanks for your help.

Is this on a public wiki, by any chance? Yaron Koren (talk) 13:28, 5 September 2013 (UTC)
Well no it is'nt for the moment... I have tried again without success. I made a workaround with the categories for now. I do not know if I am missing some thing or not.
Working on a another aspect of this same page, I found out that a subpage in a custom namespace can not support semantics. I have some properties in that page that I can not query. Must be the same problem with the [[Page has default form::form-name]]. I know it's not the right place, but as I didn't find anything in the litterature, have you already encounter this ? Thanks again !
Is it only subpages? Could this be the issue? Yaron Koren (talk) 11:43, 17 September 2013 (UTC)
Oh well that is just so obvious now that you tell me ! Yes, it resolved everything, thank you so much for your help when it comes to newbies in their learning curves (not to say the stupid ones like me ;) !! Great work, thanks again. 09:55, 18 September 2013 (UTC)

dynamic autoedit target value

Hi, I tried to use the result of an SMW query as target value for the #autoedit function. The the result template looks like this:

* {{#autoedit:form=ProjectDocument|target={{{1|}}}|link text=Add|summary={{{1|}}} added to {{PAGENAME}}|query string=ProjectDocument[ReferredByArticleName]={{PAGENAME}} |reload}}

Using target= with the query result failed,

Modifying [[]] failed. No target page specified.

only static target page values were working. Is this working correctly?

MediaWiki 1.22alpha (bc2915b) Semantic MediaWiki (Version 1.9 alpha) Semantic Forms (Version 2.5.3)

Kaboomki (talk) 09:32, 5 September 2013 (UTC)

You should be able to do that... you didn't include the actual query, but maybe you just need to add "link=none" to it, to ensure that the result is a string? Yaron Koren (talk) 13:11, 5 September 2013 (UTC)
I knew it must have been something simple/stupid... Its a great feature. Thanks! 85.178.15.146 19:08, 5 September 2013 (UTC)

{{CREATEDBY}} Magic Word in Forms

I am trying to pre-load a few info on the article when it was created. I have already used default={{PAGENAME}} to auto generate the pagename for the Name of Article textbox and I find that very useful. Is there a similar way that generates the "Article Created By" field? I noticed that there is a way to show current user like this: default=current user. But I only want to show the user who creates the article first and doesnt want this value to change each time when another user edits that article. Is that possible?

"default=current user" should work - the "default" thing only applies when a page is first created. Yaron Koren (talk) 13:37, 6 September 2013 (UTC)
Thats perfect then. Thanks again Yaron...

Remove section with no instances

I want to add a Reference Section that is optional. So I want the user to have the ability to remove this section if its not needed. Is it possible to give an option to remove section if not needed without using the Multiple instances method? At the moment, I have set it to multiple instance but the problem there is users can still add more than 1 instance on the form even when maximum allowed instance is set to 1. So is there a way for user to remove the reference section (called from a template) from the form if its not needed when multiple instance for that template is not set?

Hi - you could do it with an additional checkbox and "show on select". Yaron Koren (talk) 13:35, 6 September 2013 (UTC)
Thats a very good idea. Why didint I think of that? I guess just with this additional checkbox, I might need to have this has hidden in template so 'yes' or 'no' value is not shown on the page and only shows if the reference section was added. Thats great.. You are awesome Yaron! Hopefully this is the last trouble I give you. Much obliged with your incredible support! Thanks so much.. I will soon be releasing this feature on my site and I am very excited about it.. :)

Changing Date Format in Template

Hi Yaron, I am trying to add a date field to show the article creation date and I am not sure how to change the format that displays in the end. This is what I've done, (1) Created a Date property with type Date (2) Added this to the template: Date Created: [[Has Page Creation Date::{{{Page Creation Date|}}}]] and (c) added this to the form: | {{{field|Page Creation Date|restricted|default=now|}}}.

Although the form shows a nice dd mm yyyy format, when the values are passed on to the template, it shows 2013/09/09. How do I change it so it displays 9 Sep 2013? Is there a solution for this without needing to install Semantic Form Input extension?

See the first item here. (This is a new addition.) Yaron Koren (talk) 20:34, 9 September 2013 (UTC)
Sweet... that works!! Thank you thank you... :)

Show Preview Button Takes Too Long To Respond

I noticed that when completing the form, everything works well except when the "Show preview" button is clicked, it takes too long to respond. In Chrome, I noticed it takes about 5 secs before you know what is happening. By then I usually end up clicking couple of times wondering if I didint click it properly. But later I noticed that after this button is clicked, it takes a few seconds before the browser starts to load. The delay is even longer with IE 10. It takes almost 10 seconds after clicking on the preview button before the preview actually loads in the browser. When the button is clicked it seems as if its not responding but actually its just taking time to execute it in browser.I have so far only been testing it in my localhost and not sure if this will be the same when installed on my live environment. As anyone else experienced similar issues?

Hi Yaron, I just installed wiki and these forms on my live site. All seems well except for the form preview button. I had a chance to check it in different browsers and preview button isint working too well. This is what I found:
1) IE: When I click on Preview button in the editing screen, it takes about 5 seconds to respond. It only takes this long when editing articles that has forms. Other pages using just the wikieditor without the form responds faster.
2) Firefox: Same issue with firefox too. It takes a bit of time for it to load but IE seems to take longer than FF.
3) Safari: This is similar to FF. It doesnt take as long as IE but its seems okay but still take a few seconds.
4) Chrome: Chrome is the worst. The preview button only works once. If you press on preview again the second time, it doesnt load. Instead it shows my entire website inside the preview frame at the top and it stops there. Very wierd and its not working well in chrome at all.
Apart from the above issue, I also noticed that if the Error message shows at the top when the mandatory field isint completed, even after its completed and when the preview button is clicked, it loads the preview but the error message doesnt disappear. That doesnt make sense on why the error message doesnt get hidden even after the mandatory fields are completed.
Any input on these please?

Is it possible to load a default form when creating new articles

I have created 4 different form templates that are used to create new articles. Each form template is used for each set of categories depending what kind of article the user is creating. It works well when users follow the path of choosing the form first, entering the title in the form and then creating the article using the form. However, if a user went to a new article by typing an URL directly, it then prompts them to create a new page if no text exists on that page. When a page is created like this, there is no default form loaded since this new page doesnt have a pre-defined category yet, no namespace, etc.. So in such cases, is it possible to load a default form when user tries creating an article directly? If that was possible, I was thinking of maybe creating a separate form for this where user can choose the type from the drop down list which then forwards them to the correct form to fill out. Is something like possible? I dont want to set a default form for the main namespace since all articles in my site will be on main namespace and the form differs depending on the category they choose. So was wondering if there is an option to set a default form if no form has been defined for that article.

I don't think so. Yaron Koren (talk) 20:56, 9 September 2013 (UTC)
Fair enough. I wonder if the Extension:NewArticleTemplates would load default forms. Anyhow if it doesnt, then your other extension ApprovedRev would be handy in this case. Since I will be reviewing all submitted articles, this will be give me a chance to manually add a category to it which will in turn load the respective form in the future when others edit it. This will be the work around I guess.
When you create a page via a URL it is "just another page". This is just fine if that's what it is but if every page on your wiki should use any of the 4 forms it is not. If that is true you could also create a page (or on the main page) with 4 formlinks to the forms. Depending on what kind of page your users want to create they enter the new page name in the correct formlink and press the button. It should be easier for users to use the form then to do all the work themselves to "fill" the page. When possible explain to them that it is easier for everybody to use the "formlink page". We use formlinks to create new pages all the time. It is easier and that is just how things work on our wiki. If you want your wiki to be structured (when you need it to be) and remain structured you should make the processes more or less idiot proof. --Jongfeli (talk) 05:55, 10 September 2013 (UTC)
Hi Jongfeli, I went with your idea. I created links to various forms in the main page as well as added the relevant form link in the respective category pages so when users click on it, they are directed to the right form. Hopefully this should work and I think most users will end up using these forms. Even when those odd pages are created without the form, (which I think should be rare), I will manually add the form to it and edit it since I will be manually approving new articles and edits anyways. Thanks for your input. I will also be preparing various help documentations that explains my users on how to create articles using forms, etc.. :)

Retrieving a list of all users to be used in combobox autocomplete.

How can i fetch a list of all users to be used in autocompletion? I've tried using values from namespace=User however, that only gives me a list of users that has a User page created. (User:someuser). Is there any other way of getting all users? i see that there is an mediawiki api giving me a list of all users with an upper limit of 5000 users, however the format is not in agreement with whats expected by the autocomplete functionality.

What would be the proper solution to this?

Did you try "values from url"? The format it requires is based on the JSON format that the MediaWiki API produces, so there's a chance that that could work. Yaron Koren (talk) 12:13, 10 September 2013 (UTC)
Yes i did, i tried the query "allusers" with the json format but i think the autocomplete functionality requires a different structure of the json.
Ok so i messed about a bit and tried to test the feature with the proper format just hardcoded as a json file instead of using the mediawiki api. However i can't seem to get it to work, this is the setup i got so far:
LocalSettings:
$sfgAutocompletionURLs['ttt'] = 'http://localhost/ttt.json';
JSON:
{"sfautocomplete":[{"title":"Frank"},{"title":"Sam"}]}
Form Field:
{{{field|Authors|input type=combobox|property=Author|placeholder=Comma separated list of authors|values from url=ttt|existing values only|list}}}
What is wrong?
Ok so i seem to have found the issue, when changing the input type to "text with autocomplete" it seems to work fine, however combobox doesn't seem to fire off any xhr calls when typing text. I guess this is a bug in the software.

According to Extension:Semantic Forms/Creating query forms one should be able to prefill query forms. I can't get it to work.

If I understand right, http://discoursedb.org/wiki/Special:RunQuery/Item_query?ItemQuerier[author]=John should show "John" in the "author contains string" field.

Same in my test wiki using latest code from GIT: (http://edutechwiki.unige.ch/t/Special:Version). Test page:

In addition, the %5B and %5D, or &amp#91; and &amp#93; substitution characters for the fields [] do not seem to work when using wiki links.

Greetings ! - Daniel K. Schneider (talk) 14:39, 13 September 2013 (UTC) (apologies if I missed something)

You just need to lowercase the 'Q' at the beginning of the template name in the query string, and then it will work. I suppose that's a bug in SF - it should know that the first letter is (in most wikis) case-insensitive. Yaron Koren (talk) 14:56, 13 September 2013 (UTC)
Brilliant ! It works - thanx :) - Daniel K. Schneider (talk) 15:24, 13 September 2013 (UTC)

Implementing self reporting "widgets" and visualizations

Maybe someone can comment on this. I am trying to enhance the user experience by letting students create self-reports, e.g. tell how reading goes, writing a page goes, doing a task defined in the page progresses, etc. In given wiki pages there should be a button that will popup a partially prefilled form that prompts the user with a few questions. Data can go to a user page or a subpage or some other place. I then plan to make visualizations, e.g. in a course page.

For now, I am still learning how to use SF, but I did make a few attempts. The best one is here: http://edutechwiki.unige.ch/t/Self_reporting_to_user_page_test. It uses a#formlink: with a query string and will just pile template calls into a user page. Not very elegant, since the user will have to figure out that he should either add an item or edit an item.

Also, simple voting with with #autoedit: works, but I want users to be able so may more than "click".

Sorry, the wiki is just read not public write (don't have time for fighting spammers), but I certainly confirm real users ...

Related question: Would it be appropriate to come to Berlin SMWCon to talk about this, e.g. prepare a well formulated "case" including some half-baked attempts for solving it ? I actually thought submitting a persentation of our ideas for enhancing a non-semantic educational/research wiki with SMW stuff. Some of the easier stuff (like page navigation or dealing with structured information is almost working fine. Have to make a decision tomorrow :) - cheers - Daniel K. Schneider (talk) 15:18, 13 September 2013 (UTC)

I'm not sure if I understand the overall question, but: SF is mostly geared for creating and editing pages that many users will be able to collaborate on; much less so for content that only a single user can edit, and most likely only once. Examples of the latter include reviews, reports and comments. This has been an issue for a long time, since people have wanted to make use of SF for that kind of thing, especially since there isn't another extension that can handle it (with the possible, partial exception of LiquidThreads). SF's "partial forms" feature can be used for this to some extent, but it's far from an ideal solution. Ideally, there would be something like "partial forms" that just did one thing: add another instance of a multiple-instance template. Does that sound like the kind of you're talking about?
As to SMWCon: I think it's worth going in any case, to meet a lot of people from the community and to exchange ideas (and because it's fun). If the goal is specifically to add a feature into the software, though, there may be more efficient ways of accomplishing that - especially if you know programming. But I wouldn't try to dissuade anyone from going. Yaron Koren (talk) 17:50, 13 September 2013 (UTC)
Yeah I wasn't clear, I should think more before I write :). Anyhow, I will play some more, implement a demonstrator, look into partial forms, and then come back with questions. Indeed, semantic forms are meant for other purposes, but as you say, it's the only thing we have got and I'll try to pervert its use as best as I can. Basically I just want users to create editable and structured annotations all over the wiki and then pull these together for various "cockpits", e.g. in annotated wikipages, user pages and overview pages.
Today I signed up for SMWCon, wrote a short paper I submitted, and booked flight and hotel :). I am not a developer but can do some "end user programming" and also talk to developers. The idea was not to request features, but rather just start a discussion with interested people that then could be continued over time, also at WikiSym next year. - Daniel K. Schneider (talk) 16:52, 14 September 2013 (UTC)
Alright, great! It'll be great to meet you, and to hear about your experiences/views on SMW and SF. Though I'm still curious to hear if my assessment of your needs is correct. Yaron Koren (talk) 12:21, 15 September 2013 (UTC)

Specify Form Landing Page

Hi, as the title suggests I was wondering if there was any way to specify which page is loaded once a form has been saved. I currently have one page transcluding several subpages and links to edit the subpages with a form. Everything's working fine except whenever a subpage is saved it drops you at the subpage (as expected). Is there any way to have the user land on the parent page instead? Thanks! 75.82.195.95 05:46, 16 September 2013 (UTC)

You can't do that, but you can possibly achieve something similar by using a "popup" form to edit subpages. Yaron Koren (talk) 13:26, 16 September 2013 (UTC)
I totally missed that, hopefully it'll work for our purposes. I just stumbled upon another question. In a form, I want to let the user first select a category and then select one of that pages in that category, both through a dropdown. Basically, is there a way to pull values based on what's entered in another field? I see there's a "values dependent on" argument but I'm not following the explanation. Thanks again! 75.82.195.95 17:32, 16 September 2013 (UTC)
Either "values dependent on" or "show on select" could potentially be used for that purpose, although I don't know if either could be used for selecting a page name based on a category name, without turning it into a big hack. Yaron Koren (talk) 18:22, 16 September 2013 (UTC)
Thanks Yaron. Going back to the popup idea ... the popup does not seem to work on our wiki (I am a collaborator with the original poster of this question), and this is likely due to the fact that we are using a custom skin on our wiki. We have a popup test button if you care to see what is happening. I am fairly certain that the issue lies with the custom skin and the 'unexpected' page layout. Do you happen to have any insight into the MW skin (e.g., Vector.php) code snippet that SF_popupform.js is reliant upon (if any). I am hoping to fix this to accomodate our skin. TIA ~z929669   Talk 01:10, 17 September 2013 (UTC)
That's quite a skin! It seems like you implemented it in an unusual way, since adding "?useskin=vector" doesn't change the appearance at all. Did you implement this as a true skin, or did you do it by making changes to core MediaWiki? If it's the latter, I would recommend doing it as a true skin instead - it will help with debugging this problem, and it'll also make upgrading MediaWiki much easier in the future. Yaron Koren (talk) 11:47, 17 September 2013 (UTC)
Thanks! Credit must go to our colleague, Brian, who devised the skin himself after a couple of weeks sniffing around MW code for the first time ... he is pretty crafty. The skin is implemented as a true skin (as I comprehend the meaning of "true" in this context), but { $wgHiddenPrefs[] = 'skin'; } was set. I disabled it, and it is now possible to test the behavior under a different skin using the method you indicate above. I still cannot determine what settings are interfering with the popup under the custom skin. ~z929669   Talk 18:56, 17 September 2013 (UTC)
Oh - I don't know if you changed anything else, but now the popup form seems to be loading fine, even with that main skin - at least in the browser I'm using, Google Chrome. What browser are you using, and what's the issue you're seeing? Yaron Koren (talk) 20:16, 17 September 2013 (UTC)
Ha, you snuck in and checked that page just after I found the fix. It turns out that Brian had defined a custom wrapper class in his screen.css (i.e., not #content). I simply added in another criterion to SF_popupforms.js at line 191:
// STEP skin uses #wrapper
if ( content.length == 0 ) content = iframecontents.find("#wrapper");
... and that did the trick. Now I will see about the other question above concerning "value depends on" and "show on select". Will post back if I find out anything useful. Thanks for the quick responses! ~z929669   Talk 20:21, 17 September 2013 (UTC)

Use of "values dependent on"

I am starting this fresh in relation to the section immediately previous.

Could anyone please rephrase the following definition using different words or provide a link to a working example? This seems to indicate a conditional set based on information in another template[field]. I am not sure if my assessment is correct, but if it is, it remains unclear to me if this list is built from the values indicated for the field in existing template calls on other pages or if the values are based on properties using "allows values" or some other reference entirely. TIA:

  • values dependent on=template name[field name] - Can be used for inputs of type 'combobox', 'text with autocomplete' and 'textarea with autocomplete'. Specifies that the current set of allowed values for this field are all the values taken by this same field from pages where "field name" is equal to the value selected for "field name" in the current form.

~z929669   Talk 06:17, 18 September 2013 (UTC)

It's the former - it's based on other pages in the wiki that have the same value for that template field that the current form currently does. Yaron Koren (talk) 12:43, 18 September 2013 (UTC)
OK, rather than try to explain in words (which would be rather wordy, as I don't know how to explain it well), I'd like to present our working example. Upon entering in some arbitrary name in the form field, the first tab presents several fields, one of which is "Compatible Packs", which are selected by the user from a list populated using "values from category=Pack" (i.e., other pages generated previously using this very form). I'd like to use the "Pack" members selected in this field as sources to present valid Table list table names from the combobox available on the third tab (Mod Lists). These table names exist on previously-created Pack pages and represent valid members that the user could select (or the user could create new tables). Since table names are created using a multiple instance template and since these table names are associated with particular pack pages, I am wondering if something like this is possible. I'd like to know if these table names could even be pre-populated from a list of valid table names ... I hope this makes some glimmer of sense. ~z929669   Talk 17:11, 18 September 2013 (UTC)
I should also mention that I made some changes to what was originally a very confusing example use case. Confirmation that I have this right would be much appreciated ~z929669   Talk 21:49, 18 September 2013 (UTC)
I'm not sure what you're trying to do, but you have a field with "values dependent on" pointing to itself, which doesn't make sense. Also, I can't see that forum post without a login, for what it's worth. Yaron Koren (talk) 23:12, 18 September 2013 (UTC)
I agree that this does not make any sense, it is simply the last futile random edit I made trying to get something to happen ;) Leaving this aside, I have created two very simple, dummy classes for demonstration purposes: Class1 (Form, Template, Category) and Class2 (Form, Template, Category). Class1 is associated with property1 and property2 whereas Class2 is associated with property3 and property4. The second field of each form in Class1 and Class2 (property2 and property4, respectively) uses "values dependent on=Class1[property1]". If you would be kind enough to humor me by logging onto our wiki using the following temporary ( username / password ), I would be exceedingly grateful: ( testestest / temporary ). Following is my simple 'dummy' scenario for testing this feature:
I have discovered that "values dependent on" can only present property values that already exist in association with the corresponding field name referenced. Thus, I created two pages with Form:Class1 (Class1_Trial1 and Class1_Trial1_2). No pages have been created using Form:Class2. I am perplexed that I am presented with duplicate property1 and property3 values (value1) when entering data for new pages in both Forms. I am further confused that Form:Class1, property2 does not present valid values associated with existing property1 values (value1); however, Form:Class2, property4 does present the existing values associated with property1 (value1). These are "subvalue1" and "subvalue12" that exist in pages Class1_Trial1 and Class1_Trial1_2, respectively. This certainly cannot be the expected behavior, no? ... many thanks in advance! ~z929669   Talk 05:31, 19 September 2013 (UTC)
Yes, that's some odd behavior - the duplicate values thing is definitely a bug, and maybe the rest are too. It could be that upgrading to a more recent version of SF will fix at least some of these. Yaron Koren (talk) 14:08, 19 September 2013 (UTC)
thanks for confirming! ~z929669   Talk 18:39, 19 September 2013 (UTC)
Hi Yaron. Indeed, upgrading to SF 2.5.3 from 2.5.1 seems to have fixed this bug if you would like to verify and perhaps squish it in your dev notes. On another note, I am attempting to get Page Schemas working on the associated category with no luck ... I'll provide detail on that on the Page Schemas Talk ~z929669   Talk 20:12, 29 September 2013 (UTC)

Problems with Form Preview Button

Hi Yaron, I have been having problems with the form preview button. I just recently installed this wiki on my live site after testing it on my localhost for so long. I still have issues when clicking on the preview button when creating an article using form. It behaves different in each browser. I have updated my last post on this yesterday with info on how it works in each browsers: https://www.mediawiki.org/wiki/Extension_talk:Semantic_Forms#Show_Preview_Button_Takes_Too_Long_To_Respond

I am not sure if you monitor old posts, so I just thought I will add a topic to you address the problem I am facing. Everything else works except the preview. Can you help me please? You can read my yesterday's post in the above link for more info.. :)

I do monitor old posts, though I don't know how much I can help with this particular issue. Is this happening on a public wiki? If not, could you try replicating it on a public wiki, like http://scratchpad.referata.com? It could be something specific to that form definition. Yaron Koren (talk) 14:27, 18 September 2013 (UTC)
Hi Yaron, mine is a public wiki. However, I did a check on 3 different computers and on many browsers. I noticed that the google chrome issue that I had only happens on my computer where the preview button doesnt work when its clicked the second time. But on other computers it works fine however it takes a few seconds to respond before it loads the preview page. Also I error notice doesnt disappear even when the minimum instances are completed. So for the error message issue, I have removed the requirement of minimum instances for now so the error doesnt show in the first place. I will keep an eye on how things go once other users start using these forms. I will worry about it if many users start having these issues. If not, then its all good. Thanks again Yaron. I am very excited to launch this to my users.
Well, if it's a public wiki, feel free to link to the form. Yaron Koren (talk) 23:13, 18 September 2013 (UTC)

Queryforms affecting output of articles when using {{Special:RunQuery}} UNIQ

Hello, after upgrade, seeing weird output when displaying a queryform on articles that have other elements. For instance, Using {{Special:RunQuery/Myqueryform}} in an article that has any kind of ==section== defined will display a big UNIQ210afcb245df00b1-h-0--QINU type thing in the section heading, just before the section heading text.

Seems to do it on the Referata Scratchpad too.

Also seems to affect inline queries and {{#forminput:}} elements on the same article where the same UNIQ reference replaces the form field and these little SMW::On/Off bits show up before and after the inline query results. Happens regardless of the form specified. Tried calling a form with no fields, still does it. Ideas? Thanks! SF 2.5.3 - SMW 1.9a - MW 1.21.2 - Lbillett (talk) 14:13, 22 September 2013 (UTC)

Not that it will help you in any way, but it looks like you've run into Bug 49302, so at least it is a known/reported issue. Cavila (MW 1.19.7, MySQL 5.1.66, Php 5.3.3-7, SMW 1.8, SF 1.5.2} 17:48, 22 September 2013 (UTC)
Ah. Probably should have been able to find that. Thanks! Downgraded to 2.5.1 and things back to normal. Thanks! - Lbillett (talk) 23:48, 22 September 2013 (UTC)
FYI, I've just found a new bug report ([1]), which seems to cover the same bug. Cavila (MW 1.19.7, MySQL 5.1.66, Php 5.3.3-7, SMW 1.8, SF 1.5.2} 16:03, 25 September 2013 (UTC)

"Clear form" button

It just occurs to me again that we don't have a reset button for clearing the results from a form, which would be an especially useful addition to query forms. Would it be easy to implement this? Cavila (MW 1.19.7, MySQL 5.1.66, Php 5.3.3-7, SMW 1.8, SF 1.5.2} 16:00, 25 September 2013 (UTC)

I bet it would be fairly easy to implement, but in general I'm not a fan of reset buttons, and I think they're on their way out - you don't see them that much any more. See here for one negative view on reset buttons. Yaron Koren (talk) 21:50, 25 September 2013 (UTC)
OK, I was thinking of the scenario described under "Exception", with a slightly advanced search form that uses a lot of fields. But true, it would be a distraction in most cases. Cavila (MW 1.19.7, MySQL 5.1.66, Php 5.3.3-7, SMW 1.8, SF 1.5.2} 04:44, 1 October 2013 (UTC)

Combobox in IE10 with Document Mode IE7

FYI, when I do the following in IE10 with the document set at IE7:

{{{field|Meeting type|input type=combobox|values from category=Meeting|mandatory}}}

It works as a select box, but you are unable to type custom text into it. This is probably minimal impact for people since it has easy solutions (use a different browers or set IE10's doc mode to IE8+), but I figured I should record it here.

--Jamesmontalvo3 (talk) 18:21, 25 September 2013 (UTC)

Placeholder Text in iPad not shown properly

Hi Yaron, I have been doing tests with this form on different browsers and devices. I noticed one thing odd when the form is edited/viewed from ipads. The good news is the forms works fine in ipad so I am glad. However, when the form has the placeholder, the text inside the placeholder doesnt have a line break. I have long texts in these placeholders and they appear in 1 long line and the overflown one is cut off. It does not break it to the next line. It appears the same way a 'nowrap' setting would do with css. This only happens in ipad browsers and its fine in browsers viewed from desktops or laptops. Is this something that can be fixed?

Hi - I don't know. Is this behavior documented anywhere? Does it happen in non-SF forms? By the way, I've never heard of placeholder text that's more than a few words - if it's really that long, maybe you should put it outside of the form input? Yaron Koren (talk) 21:42, 26 September 2013 (UTC)
I havent tried a non SF forms. My placeholders are 2-3 sentences long since it gives a description on what users can type in it, etc.. inside that textarea and its useful as it gives users ideas on how to complete each field. If you have an ipad to test this out with, then I am happy to email you the link to my forms so you can have a look. If that is the case, just let me know your email address and I will send the link along with a test account for login.
Yes, I have access to an iPad - you can email me at yaron57 -at- gmail.com. Though I have to say, this strikes me as a very minor bug. Yaron Koren (talk) 22:44, 26 September 2013 (UTC)
hi yaron I had sent you the link along with a login password to your email Id yesterday. Hope you received it. :)

Just wondering if the nifty popup form functionality could be extrapolated for use on any wiki page. For example, I am using popups to pull up a form from within a page using a multiple-instance template. This is very handy, because users do not need to navigate to the another Form page to enter information: the information is entered into the popup, and the current page is refreshed with the new result without having to navigate away.

I want to apply this no-navigation popup functionality and apply it to any page, but rather than displaying a form, I just want to display a page with a "close" function. This likely is something not at all related to SMW, but SF_popupform.js offers a starting point perhaps, so i thought I'd ask about it. ~z929669   Talk 19:54, 27 September 2013 (UTC)

There's no way to do it at the moment. Yaron Koren (talk) 20:50, 27 September 2013 (UTC)

run query several values

Is it possible to define a run query form with a field that can have several values? So that it is possible to filter on several values at once?

Hi - if you can create a template that does such a thing, it should be possible to create a form around it. I think the template would be the bigger issue. Yaron Koren (talk) 17:52, 30 September 2013 (UTC)


If I understand what you're asking, we do something like that on our wiki...but it's behind a firewall so I can't show you directly. We use the Compound Queries extension. Basically we have a bunch of hardware, and all that hardware has rules associated with it. Rules are in regards to how the hardware is used, and can be about a particular piece of hardware, a category of hardware, or the location the hardware is located. Our form page looks like:

You may select multiple items in each category.
* <cntl>-click or <shift>-click to select multiple items.
* <cntl>-click again to deselect an item.
* The more items you select, the longer your query will take.

<div id="wikiPreview" style="display: none; padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid #AAAAAA;"></div>
{{{for template|Hardware Rules Query}}}
{| class="formtable"
! Applicable Location:
! Applicable Hardware:
! Applicable Category:
|-
| {{{field|Location|input type=listbox|values from property=Applicable Location|size=40}}}
| {{{field|Hardware|input type=listbox|values from property=Applicable Hardware|size=40}}}
| {{{field|Category|input type=listbox|values from property=Applicable Category|size=40}}}
|}
{{{end template}}}

The key here is that we've used the input type "listbox" and each listbox pulls from the allowable values specified on a property page.

The template looks like:

Hardware Rules Query results for the following criteria:

{{#if: {{{Location|}}} {{{Hardware|}}} {{{Category|}}} | 
{{#if: {{{Location|}}} | '''Location:''' {{{Location|}}} <br />| }}
{{#if: {{{Hardware|}}} | '''Hardware:''' {{{Hardware|}}} <br />| }}
{{#if: {{{Category|}}} | '''Category:''' {{{Category|}}} | 
}} | Nothing selected! }}

{{#if: {{#compound_query: {{#arraymap: {{{Location|}}} |,|VAR|[[Category:Hardware Rules]] [[Applicable Location::VAR]]| OR }}; ?Control; limit=5000
 |{{#arraymap: {{{Hardware|}}} |,|VAR|[[Category:Hardware Rules]] [[Applicable Hardware::VAR]]| OR }}; ?NCW Specifics; limit=5000
 |{{#arraymap: {{{Category|}}} |,|VAR|[[Category:Hardware Rules]] [[Applicable Category::VAR]]| OR }}; ?NCW Specifics; limit=5000
 | format=
}}  | {{#compound_query: {{#arraymap: {{{Location|}}} |,|VAR|[[Category:Hardware Rules]] [[Applicable Location::VAR]]| OR }}; ?Hazard; ?Control; ?Applicable Hardware; ?Applicable Category; ?Applicable Location; limit=5000
 |{{#arraymap: {{{Hardware|}}} |,|VAR|[[Category:Hardware Rules]] [[Applicable Hardware::VAR]]| OR }}; ?Hazard; ?Control; ?Applicable Hardware; ?Applicable Category; ?Applicable Location; limit=5000
 |{{#arraymap: {{{Category|}}} |,|VAR|[[Category:Hardware Rules]] [[Applicable Category::VAR]]| OR }}; ?Hazard; ?Control; ?Applicable Hardware; ?Applicable Category; ?Applicable Location; limit=5000
 | default =
 | sort=
 | order=ascending
}} | No Hardware Rules were found for this query.}}

I didn't write this query, so I can't give you any more info on it without some digging. I forwarded this thread on to the guy who did write it, though. Perhaps he'll chime in.

--Jamesmontalvo3 (talk) 18:27, 30 September 2013 (UTC)

Whoa. Okay, so - what's the issue? Yaron Koren (talk) 22:18, 30 September 2013 (UTC)
No issue for me. I was trying to help the original poster. --Jamesmontalvo3 (talk) 02:01, 1 October 2013 (UTC)
Oh, oops, I thought you were the original poster. Yaron Koren (talk) 03:43, 1 October 2013 (UTC)

As Jamesmontalvo3 mentioned, this is an example of how we use a compound query in our wiki. In the form, it has three columns with values for the user to select in the query (as James explained above). The template takes these three inputs (Location, Hardware, and Category). Each of these inputs can be a single page or an array of pages.

In the template, it begins by just listing the items selected in the form as a reminder for what was included in the query criteria. Then the #if statement begins. Note that there was a copy/paste mistake in this template and I didn't notice it until James brought this discussion to my attention. The property returned in the first #compound_query should be the same for all three of its queries. So it should have ?Control for all three instead of switching to ?NCW Specifics. This first compound query checks if any pages have the property setting them as applicable to any of the Locations, Hardware, or Categories selected in the query form. At the end of the if statement, you can see that if there are no results, it doesn't bother returning all the normal properties and instead just reports "No Hardware Rules were found for this query." I use #arraymap because multiple selections are allowed in the form for each of the three fields. So this way it can check for every page selected.

If it does find some results, then it runs another compound query, but this time it returns all the properties we want to display for these rules that apply to the items selected in the query.

I hope this makes sense. I'm still learning how to make use of these tools, so there may be a cleaner way. --Darenwelsh (talk) 22:10, 1 October 2013 (UTC)

Wow great! thank you for your reply!

Return to "Page Forms/Archive August to September 2013" page.