Extension talk:Page Forms

Stuck when using Special:CreateForm
I followed the QuickStart guide and successfully created properties and templates. Now I want to create a form via Special:CreateForm. After I choose my template and click "Add" I'm transfered to another page saying "Before template:" and a drop down menu with the 2 choices "At end" and "Template_name". I have three buttons "Add", "Save page" and "Preview" but none of them takes action if clicked.

Can you please help?

Thanks in advance!

BTW: http://scratchpad.referata.com/wiki/Special:CreateForm shows the same faulty behavior. --Stefahn (talk) 11:53, 4 September 2012 (UTC)


 * Thanks for pointing that out. That's too bad... it was just a single missing '.', due to a change made last week. I just fixed it in Git, and updated the code in Referata. I guess I'll have to release a new SF version too... Yaron Koren (talk) 15:52, 4 September 2012 (UTC)


 * Thanks for your quick reply, Yaron! Now it works fine. Also, I finally got a Git GUI working for windows :) Stefahn (talk) 23:33, 4 September 2012 (UTC)


 * Thanks indeed. Some problem and same solution, only that Git is working on my Mac ;-). One question though: the list of templates appears in some random order when I want to add a template to the form. Shouldn't that be alphabetically? --AdSvS (talk) 13:14, 6 September 2012 (UTC)


 * They're showing up for me in alphabetical order - can you point to some place where they don't show up that way? Yaron Koren (talk) 14:45, 9 September 2012 (UTC)
 * After having installed the SF version with the 'CreateForm' problem and an updated version after that, the list was in seemingly random order. After creating another template it was ok again. I'm not going to be able to reproduce this one and also couldn't make a screenshot with the list shown, so let's forget about it! --AdSvS (talk) 14:38, 17 September 2012 (UTC)


 * I have the same problem where was the missing "." in the code. I can not reach git for some reason and I could only download the tar.gz version and it is not corrected there. Could you tell me the exact location of the missing "." or update tar.gz file. Thanks in advance. Nephantes (talk) 17:59, 21 September 2012 (UTC)

Good point; I just updated the download link (something I should have done a while ago). Yaron Koren (talk) 20:52, 21 September 2012 (UTC)

Namespace declaration ignored if postbutton method is used?
In relation to archived discussion:.

I've found that the "namespace=" declaration is ignored when using the postbutton method? Ashimema (talk) 13:53, 6 September 2012 (UTC)

Info tooltip does not work in multiple instance templates
I use the following text next to a field which is in a multiple-instance template. When you view the form, the tool tip (?) icon shows next the field, but the tool tip bubble doesn't open when you click on it. I tried to open multiple instances of the template and the tool tip does not load the bubble. I have tried this with a field that does not have multiple instances in the same form and the tool tip loads the tool tip bubble.

Here is my template call within the Form Syntax

The preceding message was posted by User:81.104.213.79 on 9 September 2012
 * I can confirm this behaviour. Cavila MW 1.17, MySQL 5.5.23, Php 5.3.10, SMW 1.7.1 14:29, 9 September 2012 (UTC)

Does anyone know a solution to this? --81.104.213.79 11:02, 14 September 2012 (UTC)

Semantic Forms
Hi,

I am using semantic forms. I need to bring some of the fields to the first page with validation and also i want to send these values through url to next page.

Kindly help me to solve this problem. Reply me as soon as possible.


 * This is the right spot. :) "Spamming" a question to all sorts of locations does not help the cause. Signing your question is probably a good idea too. Cheers --&#91;&#91;kgh&#93;&#93; (talk) 14:41, 12 September 2012 (UTC)


 * This may possibly help. And yes, please stop spamming. :) Yaron Koren (talk) 02:29, 13 September 2012 (UTC)

A lot of "Allows value's" in Combobox
Hello, I am trying to do the following. The  is filled with data from a table on the MySQL instance. With the help of the External Data extension it fills all Allowed values with customer names. After saving the page there is a nice list of all the customers (+/- 800). When you press Browse properties on the property pages all customers are listed behind Allows value. All seems fine. This is a property of type Has type::Page.

With the form and template below I then create a new page and expect to see all customers listed in the Combobox that are on the  page but it only shows +/- 240 randomly from A to Y. Always the same customers are shown but never all of them.



When I do the same thing with a smaller result set (+/- 40) it works fine. I can't find any SMW setting's limiting the amount of Allows value's for a property. I am not sure what is going on here. If it would show the first 200 it would make sense but as it is now it is a little confusing. It would be very nice if I could get this to work with a bigger result set, is there a trick to get it to work or is this just to much? Thanks --Jongfeli (talk) 14:13, 12 September 2012 (UTC)


 * 800 is a lot of values! Of course, ideally it should work, but given that you're using a combobox, an alternate solution is to use "autocomplete from url" - it's less of a hack. Unfortunately, it's also harder to set up (something I hope to change), but if you can create an API script that displays the table contents in JSON form, that's what I would definitely recommend. Yaron Koren (talk) 02:20, 13 September 2012 (UTC)


 * Ok Yaron, thanks for your quick responds. I did some more testing and I think I found the problem (I created the problem myself). On the template that is used by the from there was no reference to . In the template I also use the External Data extension to fill in some data. This means Semantic Forms works fine with External Data and a lot of "Allows value's"! My "mistake", I must say it takes a while before you get the grips on a Semantic Wiki and Semantic Forms but I am learning.


 * I will do some tests to see what happens:
 * I need to assign  to   but when it is not there use the data from the External Data extension.
 * Look at the location of, when it works it is at the beginning of the template and not inside a.


 * For your reference, it works with the following extension versions (we are using the alpha versions because we want to try out the new graph functionality):
 * OS Windows Server 2003
 * MediaWiki 	1.19.2
 * PHP 	5.3.8 (apache2handler)
 * MySQL 	5.5.19
 * Semantic Forms (Version 2.4.2)
 * Semantic MediaWiki (Version 1.8 alpha)
 * Semantic Result Formats (Version 1.8 alpha)
 * Validator (Version 0.5 alpha)


 * When downloading the .tgz from Extension:Semantic Forms I still have the problem described in Stuck when using Special:CreateForm. When you take a snapshot from git it works fine. --Jongfeli (talk) 10:27, 13 September 2012 (UTC)


 * It works in a normal "table" and a . The syntax is the same except for the pipe. Problem solved.
 * Normal Table
 * --Jongfeli (talk) 11:58, 13 September 2012 (UTC)
 * --Jongfeli (talk) 11:58, 13 September 2012 (UTC)
 * --Jongfeli (talk) 11:58, 13 September 2012 (UTC)

WYSIWYG with SF 2.3.2
Hello,

I have a problem with the WYSIWYG editor (the one based on CKEditor) when using semantic forms 2.3.2. I have applied the relevant patch for it but it still won't show up. I have both SMW and SMW+ installed. Could this be a cause? Many thanks, Adrian.


 * Hi - sorry, I know very little about SMW+, or the WYSIWYG extension. Maybe other people reading this can help, though. Yaron Koren (talk) 12:28, 13 September 2012 (UTC)

Query parameters not passed
Hi, I'm having some problems with query parameters in a function. First I passed the parameters (6 of them) as a query string. Problem: the first one is not passed. Something peculiar about the first parameter in the URL string: the '=' between first parameter and value is replaced by '%3D'. For other parameters there is a plain '=' in the string.

When I passed the parameters as separate parameters, only the first one (that wasn't passed to the form before) was passed and the others were not. From the documentation It appears that all parameters can be provided separately.

It is a Dutch wiki with SF 2.5 and all versions up-to-date. Are there some limitations or conditions to the use of parameters that I'm not aware of? --AdSvS (talk) 15:23, 17 September 2012 (UTC)


 * I'm definitely not aware of this problem. Could you reproduce it on a public wiki? Yaron Koren (talk) 18:08, 17 September 2012 (UTC)


 * If you have a look on http://gbv.wikibase.nl/index.php/Testpagina you will see what I mean. The three links are essentially the same. The first has one parameter with the whole string (which works fine by the way, so I'm happy that my problem is solved!), the second the same string with 'query string=' added and the third with separate parameters. The results are different and only the first one gives a good result. I haven't been able to reproduce it on other wiki's, so something strange is going on. --AdSvS (talk) 07:46, 18 September 2012 (UTC)


 * Okay, thanks. My guess is that this is because you're using the old way of calling #formlink - without named parameters. Could you try switching to using named parameters for everything? Yaron Koren (talk) 12:39, 18 September 2012 (UTC)


 * Indeed you're right. I have used named parameters in both situations, with one query string and with all separate parameters, and both work well now. --AdSvS (talk) 13:12, 18 September 2012 (UTC)

Query forms, problem with empty fields
Hello. I've created a query form with lots of fields (all of which are properties) where the user can fill in values for one or more fields and the rest will be ignored. However, the query doesn't seem to work unless the user fills in all fields. E.g. I have a form containing the fields Country and Basin, which are also properties in the wiki (strings, with a set of allowed values). In the template I write the following query:

If I select values for both fields the query works fine, but if I only select country, the value for Basin in the query will be "" which is obviously not in the list of allowed values. How can I make the query ignore any fields which the user don't select in the field? (I saw someone suggesting to use Basin:: instead, but that seems to break the query parsing, as pipe has another meaning. I also tried escaping the pipe (with "&amp;#124;") or using Template:! but without success.) MathiasLidal (talk) 11:56, 20 September 2012 (UTC)


 * Just use the parser function "if":

missing, easy to loose track of all the curly braces...:)


 * MathiasLidal (talk) 11:56, 20 September 2012 (UTC)


 * For what it's worth, I believe just adding the pipes to the template parameters in the original query would have also worked. Yaron Koren (talk) 12:51, 20 September 2012 (UTC)

More on Embed in field / holds template
Two things: Cavila MW 1.17, MySQL 5.5.23, Php 5.3.10, SMW 1.7.1 09:31, 21 September 2012 (UTC)
 * There may be a bug: once you've hit "save and continue", it appears that new instances of the embedded multi-instance form cannot be edited. The fields become 'locked', as it were.
 * I've experienced some issues when you have about 30+ instances on a page (even if the page itself is under 8,000 bytes). Attempts to save the page can fail at times. Would it be fair to say that regular (non-embedded) multi-instance forms are a little more solid in this respect?
 * Guess what? The second issue above can serve as a solution for the first one! When those fields become frozen, you can attempt to save the page using "Save". What happens instead is that the form is reloaded with the last saved revision and the fields that were previously unusable can now be filled in. How's that for turning bugs into advantages? Cavila MW 1.17, MySQL 5.5.23, Php 5.3.10, SMW 1.7.1 10:28, 21 September 2012 (UTC)

Semantic Forms Hooks
Hi Yaron, Is there any possibility of a hook similar to the MW hook AlternateEdit - an ability to intercept the loading of the edit form. Currently, I'm subclassing SFFormEditAction, overwriting the 'formedit' property of $wgActions to point at my subclass, and overloading the show method, but doing so seems like asking for trouble down the road.

Is there any documentation on the hooks that SF provides?


 * I don't know of such a hook, but you should definitely feel free to add such a hook to your SF code - if/when you get it working, please send me a patch for that hook; I'm always glad to add hooks into the code. Unfortunately, I don't think there's any such documentation, although it would be great if there were. Yaron Koren (talk) 16:02, 23 September 2012 (UTC)

Using one form to create multiple pages?
I was wondering if it's possible to use semantic forms to create *two* separate pages using the same inputs.

I am using a form in order to create a bibliographic entry for academic articles and my form therefore asks for PaperTitle, tab-delimited AuthorNames, Year, and an article summary. My form then creates a page whose title is equal to the PaperTitle and I then use a template for that article. I also use #arraymap on authors so as to define multiple values for the property author.

Upon submitting the form, I would like to create a second page that links to the first page and is titled "AuthorLastName1, AuthorLastName2, AuthorLastName3 (Year)". This would allow users of the wiki to find the main page by looking it through article title and also by Author-Year.

Is anything like this possible with SMW? If not, are there any potential workarounds anyone can think of?

Thanks in advance, Dana
 * Just the other day I was searching the archive to see if a similar question had been asked and addressed, but I couldn't find anything. The scenario that I was thinking of myself is a form with which to create a series of pages for journal articles (which may or may not belong to the same journal volume). It would be so much easier and less time-consuming if these pages can be created in one form, but unfortunately, I don't think this is possible. (Sometimes what I've chosen to do instead is to create CSV files and import them to the site.)
 * Dana, if you need to create a lot of pages that share the same data (not in a single form though), you can define default values in the form. See the documentation. If other users complain that they don't need those defaults, you could create an alternative 'preliminary' form just for the creation of those pages with some of the default values defined in it. Cavila MW 1.17, MySQL 5.5.23, Php 5.3.10, SMW 1.7.1 08:32, 23 September 2012 (UTC)


 * Dana - you could probably do that something like that using #formlink or #autoedit (though users would have to take an extra step or two of clicking on links), but, if I may ask, why do you want to do this? Can't users find the page anyway, by searching on that text, even if the text isn't in the page title?


 * Cavila - your issue is actually different, in that you have different data in each of the pages you want to create. A CSV import is definitely one option; there was also an extension that I think allowed that, Semantic Multi Edit Extension, but it's unfortunately not being maintained. Yaron Koren (talk) 16:10, 23 September 2012 (UTC)

WikiEditor functionality not working in SF 2.5
Hey, we're running MW 1.18.1, SMW 1.7.1, SF 2.5, and wikieditor 0.3.0.

The wikieditor functionality doesn't seem to be working. It's just displaying a borderless text box around the free text.

Relevant code block: 

Any idea what's causing this? It was somewhat working on one of our test sites running SF 2.4.2 (Although I just found out it had the same display issue on Safari on that site).

--Rosencrantz (talk) 20:07, 26 September 2012 (UTC)


 * Is this on a public wiki? If not, could you look at the Javascript console, using either Chrome or Firefox + Firebug, and see if there's a Javascript error happening? Yaron Koren (talk) 03:13, 27 September 2012 (UTC)


 * It's not a public wiki, but there was a Javascript error.


 * Uncaught TypeError: Cannot read property 'wikieditor' of null Test_page:446
 * (anonymous function) Test_page:446
 * using load.php:148
 * (anonymous function) Test_page:446
 * deferred.resolveWith load.php:14
 * jQuery.extend.ready load.php:6
 * DOMContentLoaded load.php:12
 * --Rosencrantz (talk) 13:48, 27 September 2012 (UTC)


 * Okay, that's helpful - although, as I should have said before, could you add "?debug=true" (or "&debug=true") to the URL, and look at the error message again? Yaron Koren (talk) 13:56, 27 September 2012 (UTC)


 * That didn't change anything in the output. However, in fiddling around with it I did discover that this is only happening with the Special Page. If I use the Page has default form property and use the Edit with form button it works properly. --Rosencrantz (talk) 15:48, 27 September 2012 (UTC)


 * Okay, that's good to know. Are you sure it gives the same error message? It really shouldn't. Yaron Koren (talk) 16:40, 27 September 2012 (UTC)


 * I agree, it shouldn't, but it does. Well, &debug=true just changes the name of the page I'm trying to edit so I had to use ?debug. One interesting thing is that it throws a different error in Firefox with firebug.
 * TypeError: window.ext is null
 * jQuery(function{mw.loader.using("ext.semanticforms.wikieditor",function{jQuery('#sf_free_text').SemanticForms_registerInputInit(window.ext.wikieditor.init, null );},function(e,module){alert(module+": "+e);});});
 * Another oddity I found is that users who are logged in see the bar. Once you log in, the edit bar disappears. --Rosencrantz (talk) 19:52, 27 September 2012 (UTC)

I talked about this issue with Stephan Gambke, who wrote the main code for dealing with WikiEditor. Neither of us understands what's causing the error, although we agreed that a bug report about it would be very helpful. If possible, could you submit a report about this on Bugzilla? Yaron Koren (talk) 03:14, 28 September 2012 (UTC)

Ask queries with multiple instance embedded templates
I am having trouble getting the results that I want from an ask query while using multiple instance embedded templates. I am rather new to semantic mediawiki and media wiki in general, so I am unsure if it a problem that I am having or if the extensions can handle what I am trying to do.

I have 4 templates. One main templates and 3 templates that I use as multiple instance embedded templates and I am using SIO for the multiple instance templates. I can provide examples of each of these templates and the form that contains them if they are needed, but I think most of my issue lies in how I am setting up the query. I can get the query to return any of the properties from the page except the multiple instance templates. Adding their name to the property list returns nothing. I can, however, get a list of the values of a property from inside the multiple instance templates by querying the name of that property. What I really want is the properties of each instance as a group, similar to an object. From reading about SIO, it seemed like SIO would be able to do this, but as I read more and more it seems like SIO is intended to go from the internal objects to the parent, not the parent to the objects, the way I would like it to.

Pretty much I am just lost. I know I didn't give much information, but I can give more if it is needed. Basically, I just wanted to know if I'm on the right track or if what I am trying to do is even possible. Any help is appreciated and I am more than willing to give more information if it is needed.


 * This doesn't sound like an SF issue. What's the query you're trying to run? Yaron Koren (talk) 03:15, 28 September 2012 (UTC)


 * Sorry it's taken so long to get back with the example. My main template is similar to this:

&lt;/pre&gt;


 * And here is an example of the multiple instance embedded template I am using:

&lt;/pre&gt;


 * And the query I am trying to run would be something like this:


 * So this will give me a list of values for each MITProperty, like MITProperty1=value1,value2,value3. What I am trying to get is a separation of these values, like MITPropoerty1[1] = value1, MITProperty1[2] = value2, MITProperty1[3] = value3.
 * This may not be possible, and it could just be the way that I am trying to store the data and/or run the query. It is likely not a problem in semantic forms, but rather my lack of experience.


 * This definitely isn't an SF issue - it's a data structuring issue, or maybe a syntax one. Most of your syntax here looks incorrect, but I'll assume that it's correct in the original. The key thing to remember, when using SIO (or subobjects), is that the properties you're storing don't apply to the page itself, but rather to an object within the page - so you can't get the properties of the object and the page at the same time. Yaron Koren (talk) 16:53, 3 October 2012 (UTC)

Referring to field values in form definitions
I am stuck defining a form for a simple sports league management system.

I got a hierarchy of pages with associated semantic properties: League containing sub pages Teams, Venues and Tournaments. When defining a tournament it should be possible to select which teams participate in that specific tournament, but since there could be multiple leagues, the selection needs to be narrowed down to teams associated with a particular league for which the tournament belong.

What I really need is a field definition along these lines:

But that obviously does not work since the is not available in the form page.

Any idea how I could get around this?

Example page: Form:


 * You could use the "values dependent on" parameter. Unfortunately, it currently only works with the input types "combobox" and "text with autocomplete" (the latter would be the relevant one for you, since you could have multiple values) - though I do hope to get this functionality working for dropdowns, checkboxes etc. as well. But if you're fine with having users type team names and have autocompletion on them, instead of using checkboxes, that's what I would recommend. Yaron Koren (talk) 13:49, 30 September 2012 (UTC)


 * Ideally I would like this to be usable for people with very little computer literacy and absolutely zero knowledge of wiki markup, so really checkboxes would be preferred. However, I'll give the autocompletion a shot.  Thanx for the hint! Lbthomsen (talk) 04:20, 2 October 2012 (UTC)


 * A very generic way of solving this problem would be an ability to pass simple "variables" to a form. Say it was possible to link to a form like this:


 * And then being able to use those variables in the form definition page - parsed before anything else - for example like this:.


 * However, I do realize that this would break the "edit with form" functionality. Another approach would be an ability to set values based on templates.  In other words to expand templates and parser functions inside form fields.


 * Both approaches would make it possible to make context dependent checkboxes for example but I do realize that while the first approach is probably the easiest to implement, it would only cater for very specific uses while the second approach would be more generic. Lbthomsen (talk) 00:25, 8 October 2012 (UTC)


 * I just had one other idea that might be easy to implement and quite usefull for this. Let's imagine a form with a hidden field that is set in the call:


 * Now if only it was possible to refer to value this field had upon form rendering that would solve the problem:


 * In other words - just a way of rendering pre-set field values in the field definitions (wouldn't have to be full-blown expansion of templates/parser functions so it probably shouldn't use parser function syntax as in the example I just gave). This approach wouldn't break the Edit with form functionality as the hidden field would just remain there. Lbthomsen (talk) 00:34, 8 October 2012 (UTC)


 * That might be possible with the UrlGetParameters extension. Yaron Koren (talk) 02:42, 8 October 2012 (UTC)


 * I actually tried various combinations of template inclusions and parserfunctions, and as far as I can see they do not work in the fields. I didn't try the UrlGetParameters, but experimentally I tried a "values=  " (and a few other parser functions too) and that didn't seem to work (will result in one checkbox with a value of the string {{#xxx included). But yes, if that syntax was possible it would be possible to create context dependent checkboxes. Lbthomsen (talk) 16:35, 8 October 2012 (UTC)

Label only in embedded field when multiple
Hi, it seems that a label only appears when using 'multiple' in an embedded field. For example: doesn't make the label show, and does. Is that supposed to be? I would like to have the label in both cases. --AdSvS (talk) 09:39, 4 October 2012 (UTC)


 * Ah, I didn't even know you could use "embed in field" without it being a multiple-instance template. That's essentially an unsupported feature... why would you do that, as opposed to just making the parameter(s) of that inner template parameter(s) of the main template instead, and cutting out the middleman? Yaron Koren (talk) 14:03, 4 October 2012 (UTC)


 * It works fine, except for the label ;-). I want the set of data (meeting data that can be downloaded as iCal) appear on the form in a square with label and on the page itself embedded within the main template. If I put everything in one template I can't have the square with label on the form and if I use 2 ordinary templates the data can only be presented sequentially. So I'm really a fan of this middleman actually... --AdSvS (talk) 14:40, 4 October 2012 (UTC)


 * Hi - no, I don't mean having the two templates sequentially, I mean getting rid of the 2nd template altogether, and just passing all the fields in to the 1st template. Yaron Koren (talk) 15:00, 4 October 2012 (UTC)


 * Hi, by the way, will you be attending the SMW conference? If I put everything in 1 template I can't have the square with the label on the form, can I? --AdSvS (talk) 15:04, 4 October 2012 (UTC)


 * Probably not, and no - unless you modify MediaWiki to support the &lt;fieldset&gt; tag. (Which I actually think is not that hard to do, but I don't remember now). Yaron Koren (talk) 18:41, 4 October 2012 (UTC)

Disable sorting for multiple-instance templates?
I'm quite new to Semantic Mediawiki, so this might be obvious: I have a multiple-instance template consisting of two fields. When I #ask for this template I get all instances in natural order of each instances first field. But I just want to get what I entered. When I look for the pages source or try to edit my page I see all instances in correct order. I can drag my instances when editing but that doesn't affect my output. Thanks for any help. Bob


 * Are you saying that, when you rearrange the instances in the form, it doesn't affect what's in that page, or it doesn't affect what shows up in an #ask query on another page? Or both? Yaron Koren (talk) 17:27, 9 October 2012 (UTC)

Multiple instances with one header row
Hello, I have a page that contains multiple instances of a particular set of data. I've tried to arrange this data so that each instance is one row of a table of data. I'd like to have a header row that identifies the field names of each row. This is certainly possible with the template, but using that method, the header row is displayed above each instance--with a number of instances, this gets messy quickly. I can add a header row separately, but if I edit the data via form and then save, the header row (like any data on the page that occurs above the semantic data) falls below the semantic data. Any ideas on how I can achieve one row of header data, with the multiple instance data below?


 * I would recommend using "embed in field" and "holds template", if you haven't heard of those - they make headers and footers much easier. Yaron Koren (talk) 22:29, 11 October 2012 (UTC)


 * I needed exactly the same - to be able to customize the html wrapping multiple instance templates - I achieved it by adding some hooks to SF_FormPrinter.php which allows me to customize the HTML being output by the multipleInstanceHTML and multipleInstanceTableHTML functions. I'll submit it as a patch for SF, and I'll put the url on here when I've done so. Andrujhon (talk) 10:04, 30 October 2012 (UTC)

Question on semantic query search engine
Hi,

I am trying to make a "search page" using queries in a wiki. I would like to let the user search text (system engineer in the example) and numbers (mass) >,< or = to a value and I am having some trouble to achieve the query for numbers (>,<, = are not numeric characters).

In the template I wrote this query following the example shown in (http://discoursedb.org/wiki/Special:RunQuery/Item_query?ItemQuerier%5Bauthor%5D=A&ItemQuerier%5Bsource%5D=New&wpRunQuery=true). The ~* seems to be only right for text values but not for numeric values. What is the right way to ask for a numeric parameter? And how could I introduce the >,<,= in the query? So that the search is more flexible for the user.

and then in the form I wrote this for the search:

Thanks a lot!


 * This was answered on the mailing list. Yaron Koren (talk) 13:36, 16 October 2012 (UTC)

New bug?
Hi Yaron. I recently upgraded to MW 1.19.2 and updated all my extensions accordingly. One particular page became inaccessible, unless I commented out SF from localsettings.php. It gives me the following error message:

Schematically, the page looks like: =A= Text. Lore ipsum. Blablabla.

Dynamic combobox with "values dependent on="
Hi, I'm having trouble using the "values dependent on". I have a property "Car manufacturer" with for value Audi,Citroen.... Then I have a property per car manufacturer with their car model (property Audi with for value A3, A4 etc...)

I want a first combobox listing all the car manufacturers and then a combobox that would list the car models upon the car manufacturer previously selected.

In my form: |- ! Car manufacturer: ! Car model:

The problem I'm facing is that when I select a car manufacturer the car model list stays empty.

What am I missing? Thanks in advance.


 * The fact that the template is called "Find" might point to the issue - is this a query form? If so, the system may not know what semantic property each of those fields corresponds to - you can fix that, I think, by adding a "property=" parameter to both field tags. If that's not it, I don't know - try checking the Javascript console, using either Chrome or Firefox + Firebug, to see if there are any errors. Yaron Koren (talk) 12:13, 19 October 2012 (UTC)


 * No it is not a query form. The name is currently not relevant to the application as it is still under development. The user looks through the list of cars and enter a commentary and then saves it. Does "values dependent on" works with properties?


 * Okay. Yes, it's based around SMW properties. What about the error console? Yaron Koren (talk) 16:37, 19 October 2012 (UTC)


 * The console reports no errors... I tried to add the car models in a property "Car models" and added:"property=Car models"

|- ! Car model:


 * But now no matter what I select in Car manufacturer I see all car models in the Car model combobox...


 * I'm running out of ideas.


 * Hi - what's the template name - "Find", "Order", or something else? Yaron Koren (talk) 18:18, 19 October 2012 (UTC)


 * Hi, Sorry I didn't say but I've changed the name from "Find" to "Order"...

I would change the "values from property=" parameter in the "Car manufacturer" tag to just "property=". My guess is that SF isn't able to connect the template fields to the SMW properties. Yaron Koren (talk) 18:27, 19 October 2012 (UTC)


 * I tried it but there is nothing new. The Car manufacturer lists correctly. It is the Car model that lists all the car models and not just the models of the selected Car manufacturer.
 * In my Form:

! Car manufacturer: ! Car model:


 * Okay. What do the relevant parts of the "Order" template look like, by the way? Yaron Koren (talk) 18:53, 19 October 2012 (UTC)


 * The relevant parts of the template:

! Car manufacturer ! Car model
 * Car manufacturer::
 * Car model::


 * Okay. I should have just asked this a while ago, but could you try to reproduce this issue on http://scratchpad.referata.com? Yaron Koren (talk) 19:14, 19 October 2012 (UTC)


 * I reproduced it. Form:DynamicCombo

Hi - thanks. I "fixed" the problem, just by creating a page that called that template, and set both fields. My guess is that that's what you're missing. Yaron Koren (talk) 21:29, 19 October 2012 (UTC)


 * Hi, Thanks a lot for your help! I'm a bit disappointed by the way this thing works... I can't reuse the properties of my wiki, and the list is long. Any ideas on how I can make it easier to use?


 * Sorry, I don't understand what you mean. Yaron Koren (talk) 19:19, 21 October 2012 (UTC)


 * Let me recap:
 * I have a main page on my wiki with a very long list of cars. I have Car manufacturers (Audi, citroen...), Car models (A4,A5,C1...), and Car year(2004-2005, 2007-2008). A Car manufacturer has several models, and a model has several years. I want them all to be linked appropriately so for example an Audi A4 would not be in the list of Citroen.
 * To do that I created a property for each car manufacturer, a property for each car models. (maybe it is not the best way)


 * Independently of this main page (which is the only one that I want to be manually updated when adding new cars) I want a form that "automatically" lists all the cars that are on the main page.


 * From what is on the referata, the listing would have to be done manually by calling the template... which is not good for me.


 * So to populate "automatically" the car list that would work on the "values dependent on=" in the form I would like to use the properties already existing instead of calling the template each time I add a new car to the property (it would be too redundant)


 * I created the page "CarMain" with the type of data I would normally have on my main page. And the page "Car list" with the way that works but redundant.


 * Does that make more sense?


 * Okay, I think I basically understand. The issue, I think, is that you should simplify your data structure: the car model should always be pointed to with a property called something "Car model", etc. Text like "Audi" should only ever be a property value, not a property name. Yaron Koren (talk) 13:43, 22 October 2012 (UTC)


 * My first idea was to have the cars as value only but I changed it because otherwise I don't see how to link certain "Car model" to certain "Car manufacturers"... how would you know that a Car model::A4 goes with a Car manufacturer::Audi and not a Car manufacturer::Citroen when listing them? I must be missing a fundamental idea.

Can a page have more than one car on it? If so, the solution is to store the information using subobjects, or Semantic Internal Objects. Yaron Koren (talk) 16:27, 22 October 2012 (UTC)


 * All the cars are on a single page. I guess I'll have to use the internal object then... Thanks a lot for your help !
 * Just another quick question: The #subobject on the referata does not behave the same way as on my wiki. The difference seems to be on the version of the Semantic MediaWiki. I'm running version 1.7 and the auto numbering seems not to work. Will the new version be released soon? Or is it better for me to use an other way to link the properties together?


 * There's not a fixed date for SMW 1.8 yet, as far as I know. I'd say, for now, you're safer using SIO than subobjects, for that reason. Yaron Koren (talk) 13:06, 25 October 2012 (UTC)


 * Ok Thanks! I switched to SIO and it's fine. Thanks !

Preloading fields from one page to a super_page
I have a contact using Client form and template. I want the contact information to populate a fax page.

I have the the fax cover sheet being created with the correct name but the fields are not populating. I have tried all kinds of codes and this is the last version below. Would someone flush out my code? thank you so much for this extension and your help.

--Amblerllc (talk) 02:28, 23 October 2012 (UTC)


 * You have a mix of named and unnamed parameters, which will probably cause problems - you should have a variable name for each parameter. Also, you should replace all the "|" with "&" after "query string=". Yaron Koren (talk) 12:23, 23 October 2012 (UTC)


 * Thank you for your quick response. I will continue to investigate variables. Is there a page that has more infomration about use of Variables? Also, The mixed named and unnamed parameters would be the templatename[fieldname] and super_page= ? Thanks again! --Amblerllc (talk) 17:54, 23 October 2012 (UTC)


 * No, I mean stuff like that the 2nd element should be "link text=ODAR Fax Cover", not "ODAR Fax Cover". Yaron Koren (talk) 19:36, 23 October 2012 (UTC)


 * SOLUTION
 * Downloaded and installed Extension:Variables
 * Wrapped template (the template that displays already populated data)fields with:

.
 * I changed my #forminput to read: (note that the template-name[field name] uses the template that will be preloaded)


 * I hope this helps others.


 * Oh yeah, I didn't even notice that you were missing values for the variables. Cool, I'm glad you got it working. Yaron Koren (talk) 03:24, 24 October 2012 (UTC)

values from category does NOT deliver only the category pages
Hello everyone,

recently persuaded to go the semantic way, I have up'd our wiki with Semantic Mediawiki and Semantic Forms.

Trying out the semantic form creation, I noticed that the restriction of values to one category only seems not to work.

E.g.:



{| class="formtable"

! width=""00px"|Image:

|

| Please right the wiki page name of the image file, if there is not file yet, please upload.

|-

! City:

|

| Use this field to select a city from the range present.

|-

Can be seen here: http://wiki.rockinchina.com/w/Form:Add_a_New_Venue

However later on when I start using the form and create a page, I am allowed to enter any kind of value.

I have also used the "mandatory" value, the "restrict to existing values" and also the "combobox" attribute to generate a drop-down-field.

I searched the talk pages and found in 2009 the following topic: https://www.mediawiki.org/wiki/Extension_talk:Semantic_Forms/Archive_August_to_September_2009#.22values_from_category.22_also_shows_subcategories

Is that still the case that it automatically uses all Subcategories pages' as well?

Or is there a work around without having to restructure >100 categories and pages?

Thanks --Azchael (talk) 05:54, 26 October 2012 (UTC)Azchael


 * It sounds like you have two different issues there. For the first, of restricting the values to the set of cities - you would need to use an input type that restricts values, like "dropdown", "radiobutton" or "combobox" (with "existing values only"). What happens if you try one of those? For the second - do you have some subcategory of "Cities" that you don't want included in there? If so, there are ways to get around it, but I'm surprised that you would have such a thing, in this case. Yaron Koren (talk) 10:50, 26 October 2012 (UTC)


 * Apologies for the late reply. I have tried comboboy and existing values. Have updated the form, you can have a look. And yes, I unfortunately have a lot of pages in Category:Cities that I DO NOT want to include. During setting up of the categories we have thought in the way of having subsets of larger entities in categories but also a lot of related stuff, e.g. for Cities we also have Sub-Category "Beijing" (as it is a city) and within " Category:Beijing " we have "Category:Beijing Artists" or "Category:Beijing Venues" which at that time made a lot of sense to have a topic together, but now we could either find a way to restrict the values OR to redo the whole classification of the wiki categories... Any suggestions? --Azchael (talk) 11:47, 29 October 2012 (UTC)


 * It looks like the combobox thing works. As for the 2nd issue - that's a tricky case. From the SMW perspective - not just SF - your category system (which is similar to the style of Wikipedia's) is not ideal, because it doesn't make enough use of properties: something like "" would be better as " Has city::Beijing", and ideally both would be set via a template. But if you don't want to overhaul the whole wiki, one relatively easy fix would be move all the city categories to a category called "City categories" - or, conversely, to move all the city pages to a category called "City pages". Yaron Koren (talk) 15:51, 29 October 2012 (UTC)


 * Thanks, I have changed the category system. That was the right thing to do. --Azchael (talk) 12:20, 30 October 2012 (UTC)

queries on values in multiple use templates
I have tasks that are being tracked on a client form.

My client wants a list of tasks that are assigned to herself. Of course the task form is an embedded template and can be used multiple times. This creates multiple task values. Some of those values are my clients and some are her employees.

When I use the table format query all the items display in the table center justified and you can't clearly see what Task Due date lines up with Task. Plus the query doesn't filter out the task assignment. It shows all the task not just Task Assignment property.

Is there a solution here to query on multiple values? Thanks again for any help you can offer. --Amblerllc (talk) 23:53, 27 October 2012 (UTC)


 * You should switch that multiple-instance template to use Semantic Internal Objects to store its data. Yaron Koren (talk) 22:00, 28 October 2012 (UTC)
 * OH. I was afraid you might say that. I hope I can figure that out in the next 8 hours! :) Thank you so much! --Amblerllc (talk) 15:33, 29 October 2012 (UTC)
 * Am I understanding this... if I remove the multiple templates statement then I am generating multiple pages through a querylink and the pages are the "object"? such as carrotcake in the example? Is there a good display for the use of semantic internal objects? --Amblerllc (talk) 22:30, 29 October 2012 (UTC)


 * No, you should keep it as a multiple-instance template - you just need to modify the template itself. Here is an example of a template that uses SIO. Yaron Koren (talk) 22:52, 29 October 2012 (UTC)

Use input of #forminput to preload field
Hi Yaron,

I'm trying to do the same as mentioned in this thread: using the input of the #forminput to preload a field in the form. Is there maybe a way to achieve this now?

Would be better than to hardcode it in the template via.

Thanks,

--Stefahn (talk) 00:13, 30 October 2012 (UTC)


 * Hi - no, there's still no way to do it. But I still think the proposal I gave is the better solution anyway - have that field be blank by default, and have it override the page name if it's set. Yaron Koren (talk) 04:23, 30 October 2012 (UTC)


 * Thanks for your quick reply! The "problem" is I want to give users a possibility to add links to our page (with URL, tags and description). Users should enter "example.com" in the #forminput field - and in the second step the field "URL" should contain what they entered in the first step PLUS "http://" before it. Any idea how to achieve this? Thanks. --Stefahn (talk) 08:26, 30 October 2012 (UTC)


 * Okay - can't the template add the "http://" to the page name? If so, I would think that's the better way to go. If you really want to use the page name value in the form, though, there's probably a way to do it using "default=" and the #titleparts function from the ParserFunctions extension. Yaron Koren (talk) 18:07, 30 October 2012 (UTC)


 * Yes, I would like to use #titleparts or #explode. The question is what is the input for those functions? If I use a magic word like it gives me the name of the page on which I placed the #forminput... I think I would have to extract the data directly from the URL which is generated after I push the button "edit or create". Is that possible?--Stefahn (talk) 22:33, 30 October 2012 (UTC)


 * Nevermind - I solved this issue differently :) If you like you can see the result here. Still using a lot of tricky string functions :) --Stefahn (talk) 19:36, 31 October 2012 (UTC)

Cancel doesn't work for me after (not) filling out a form.
I am running MediaWiki 1.19.2 with Semantic bundle 20120327, installed. I have been able to do some great things with these tools.

However, if I want to abandon the creation of a page using a semantic form by clicking on Cancel at the bottom of the page, nothing happens except a refresh of the form fill-out screen I was on.

This is a very solid bug for me as it happens with all forms in all cases.


 * Same happens on my MW installations. I don't have a solution for that but I can report another bug (maybe this is related to the cancel issue): Previewing a new Semantic forms article works, but if I hit "Save page" in the preview I get a popup asking me if I want to quit the page (I have set $wgDefaultUserOptions['useeditwarning'] = 1; and this works fine usually). --Stefahn (talk) 19:32, 31 October 2012 (UTC)


 * I believe these are two unrelated issues. The first one, I think has been fixed already in a more recent SF version - I hope we can release a new Semantic Bundle at some point soon that includes newer versions of a lot of the extensions. I haven't heard of the 2nd issue. Stefahn - I assume you're using the Vector extension (and skin)? Yaron Koren (talk) 13:48, 1 November 2012 (UTC)


 * Yes, I'm using the Vector extension and skin. Does this issue only occur in Vector? --Stefahn (talk) 16:09, 1 November 2012 (UTC)


 * Well, I think that "are you sure" popup can right now only be done with the Vector extension. Anyway, thanks for the bug report - hopefully we can get this fixed soon. Yaron Koren (talk) 16:35, 1 November 2012 (UTC)

PS: The line is added when one creates a form with the help of Special:CreateForm. But you probably know better ;) --Stefahn (talk) 00:12, 7 November 2012 (UTC)
 * Just found out that this bug is correlated with the line  If I delete the line there's no issue when you hit save within the preview.

$ signs in text fields
I am not sure if this is where I should post this question. When my client enters a $ as the first character in the text property the display dissappears in read display.

Is there something I can do to stop this? Thanks,

I figured out that string type and text type will not allow $ signs or the next two characters after the $ sign in an embedded template. Is there a fix?

Im still stuck. Thought I would let you know if I have any multiple/embedded templates anywhere in the form and I change another field in thoses templates it wipes out the text field with a $ sign in another form field. :( Ambler LLC


 * Please check if the wikitext source code of the page is correct - i.e., if the correct value, starting with the "$", is there in the template call. If so, then this isn't a Semantic Forms issue, but (probably) a Semantic MediaWiki issue. If so, your best bet would be to file a bug report on Bugzilla. Yaron Koren (talk) 13:52, 1 November 2012 (UTC)


 * Nope. the $ sign is not in the source code. Here is what I have figured out. I knew it was happening on the multiple instances. I removed one multiple instance. It was still happening BUT, I also had two of the same form fields in the form. Once I renamed one of the form fields and had all unique form fields the $100 displays $100.
 * Next I went to the other multiple instances and figured out that $ 100 displays $ 100 but $100 displays 0. It cuts the dollar sign and two digits off the display.
 * My conclusion is that when you have two or more of the same fields on a page the $ signs drop of without a space after the dollar sign. I hope this is understandable. BTW: The first display will look fine but when you go to edit another multiple instance, the display goes bad on the one that look correct on the last save. Thanks again for your attention on this. AmblerLLC


 * Okay, that's good to know. Is this viewable on a public wiki? If not, (a) what version of SF are you using, and (b) if it's not too much trouble, could you try reproducing this bug on a public wiki, like http://scratchpad.referata.com ? Yaron Koren (talk) 16:40, 1 November 2012 (UTC)


 * MediaWiki 1.19.2/Semantic Forms 2.4.2/Semantic MediaWiki 1.7.1
 * It is not a public wiki. I will try to recreate the problem but I can't use the same forms. My client would kill me. She is a little protective of her application. Ambler LLC


 * Ok. been a long day. Here is the link to to the scratchpad! dollar test--Amblerllc (talk) 03:10, 3 November 2012 (UTC)


 * Thanks for putting that demo together. That was a real bug, and I was able to fix it - if you're using Git, you can just pull the latest code; otherwise you could fix it in your own code by just reproducing this change. Yaron Koren (talk) 16:28, 4 November 2012 (UTC)


 * Thank you so much for looking into this. I thought the demo was going to be a failure because the $ signs showed up in the source. Thanks again!. Margaret --Amblerllc (talk) 19:51, 5 November 2012 (UTC)

placeholder for {{#formlink... resp. {{#forminput
Hi,
 * proposal for {{#formlink... resp. {{#forminput
 * add the placeholder-Attribute (like in forms, see http://www.mediawiki.org/wiki/Extension:Semantic_Forms/Defining_forms)
 * thx ;)

Cheers, --213.33.94.194 14:30, 5 November 2012 (UTC)


 * That makes sense for #forminput, but how would it work for #formlink? And what does "resp." mean? Yaron Koren (talk) 14:59, 5 November 2012 (UTC)

Suggestion: Remove hard-coded background colors for various elements
Hi,

I have installed Semantic Forms and am using it since quite some time. One particular thing I noted is that the various elements are getting assigned usually white or light grey background colors.

It seems that is happening EITHER in one of the CSS or is even hard-coded into the PHP files, such as in specials/SF_CreateForms.php where it says:

// 3 values per row, with alternating colors for rows if ( $i % 3 == 0 ) { $bgcolor = ( $i % 6 ) == 0 ? '#eee' : 'white'; $text .= ""; }

For most wikis that work with a light background color and a dark font that should have no complications, however for wikis with dark skins (such as my own), and very light fonts (white) you will get a white box with all text in white, until you manually disable the color functions.

Suggestion: - Move all color attributions into classes and create one single CSS file title "skin-related.css" where these classes (and its colors) are defined. - For wikis with more than one template and more than one style (various background colors), they could delete these individual classes or leave them empty and re-declare them in their individual skin CSS files

--180.94.145.167 02:31, 7 November 2012 (UTC) Azchael of Rock in China


 * It's a good idea to un-hardcode all the CSS. Most of the CSS already is in CSS files - SemanticForms.css and others. Wouldn't it work to just move the remaining CSS into those files? Yaron Koren (talk) 05:27, 7 November 2012 (UTC)


 * It would work for all elements that are marked up with CSS styles in the PHP files. But for the example as shown above, one would have to change the PHP code to switch from an automatically created table background (either white or eee) to two individual classes that are being assigned (e.g. row_even and row_uneven). --180.94.145.167 07:30, 7 November 2012 (UTC) Azchael of Rock in China


 * Yes, of course. Yaron Koren (talk) 15:04, 7 November 2012 (UTC)