Extension talk:Page Forms

Always display query string?
How can I make my form to display a query result page, so that the query string is always shown in the URL line? is there a simple setting for this? Osishkin (talk) 06:55, 1 March 2013 (UTC)


 * You mean, have Special:RunQuery show its values in the URL query string? I don't think so; why do you want that? Yaron Koren (talk) 13:40, 1 March 2013 (UTC)


 * I want to allow users to share (facebook, email etc) pages of query results using an AddThis button. But since the query string is not displayed (I assume due to using a POST request), this is not possible Osishkin (talk) 22:09, 1 March 2013 (UTC)


 * Hm, that's true. Maybe a "link to these results" link at the bottom of any set of results would fix the problem? Yaron Koren (talk) 14:19, 5 March 2013 (UTC)


 * I can create that manually, but it would be much better to simply have the results in the URL line, so the AddThis button may be used Osishkin (talk) 14:59, 5 March 2013 (UTC)


 * By the way, this would also be useful for tracking search queries with Google Analytics Osishkin (talk) 12:01, 9 March 2013 (UTC)

Create dynamic form
I am trying to create a form describing a multi-step process, where the number of steps isn't necessarily known (e.g. imagine a system for creating recepies, where the number of steps may vary). Is it possible to create a form which is dynamic, i.e. that it is possible to add new fields on the fly? (Similar to the CreateTemplate page where you have an "add field" button)

MathiasLidal (talk) 12:52, 5 March 2013 (UTC)


 * Yes - that's what multiple-instance templates are for. Yaron Koren (talk) 14:08, 5 March 2013 (UTC)

Preload of text input field with special string
Hello, I need to preload a text input field with a special string which is joined together by the string "hvg" plus the hexadecimal Unix timestamp. The PHP formula would look like:

$var = "hvg". dechex(time)

Can I do this without writing an own extension? If yes, how?

Many thanks in advance for any support!

Cheers...

--Sochin67 (talk) 15:46, 8 March 2013 (UTC)


 * For something that specific, I think you'd need an extension. Yaron Koren (talk) 20:32, 8 March 2013 (UTC)


 * Created my first little extension and it works ;-) --Sochin67 (talk) 20:38, 17 March 2013 (UTC)

Embedded template: list of values for field
I know how to define list of values for property so field for this property becames dropdown list with this list of values. But is it possible to define such behaviour for embedded template (with multiple) that defines subobject? Are subobject's fields real properties? Please, give me a clue or small example. Thanks


 * Yes, the fields in a #subobject call are real properties, and they should be defined on the wiki - including a list of allowed values where necessary. It could be, though, that Semantic Forms won't make the connection between a field and its property, if you use #subobject - if that's the case, you should add a parameter like "|property=property name" to each of those fields' tags.


 * Thanks, it works!

Subpage behaviour
Hello, In SF 2.5.1 I've noticed that pages within a subpage (Namespace:Basepage/Subpage) seem to ignore default form (in both NS and category). I think it didn't happen in some 1-2 years old versions. Is this an intended behaviour? If so, how should I fix this? Thanks! --Toniher (talk) 17:55, 13 March 2013 (UTC)


 * Yes, subpages no longer get the default form for their namespace - the thinking behind it was that subpages rarely have the same structure as main pages. As for the category not having an effect either - that sounds like a serious bug. Or do you just mean that page A belongs to a category, but page A/B doesn't get the form for that category? Also, out of curiosity, what namespace is this? Yaron Koren (talk) 21:12, 13 March 2013 (UTC)
 * Hi Yaron. It's a custom Namespace (Private). However, I'm wrong: it works with categories. No with subcategories (but I see you already commented it here). Mystery solved. Thanks! --Toniher (talk) 10:18, 14 March 2013 (UTC)

Autocomplete on categories with SQLStore3
There is aapparently problem with the "values from category" option. I use it with a combobox, but it pulls every page in the wiki on autocompletion instead of restricting it to the pages from the appropriate category.


 * MediaWiki: 1.20.2
 * Semantic Forms: 2.5.2
 * Semantic MediaWiki: 1.8
 * SQLStore3

Delete a page using a form
Hi Yaron,

thanks for the great work! I use SF 2.5.1 on SMW 1.8/MW 1.20 with formlink and popup to create and edit items on a list (saved as subpages). Do you see a possibility to delete a page as well using SF, maybe using a standard input or a parameter for the formlink? Or could one set a link with parameter action=delete and enable popup for it as well?

Thanks in advance

--80.149.87.126 13:57, 15 March 2013 (UTC)


 * I don't think there's any way to do that - you would need a separate parser function to handle deletions. (Though it may not be a good idea anyway.) Yaron Koren (talk) 22:12, 15 March 2013 (UTC)


 * Ok, I can see that. Would it in general be possible to popup a regular link to an internal (or external?) page? Currently I have set a link to the regular ::action=delete page (users have the right here), but it somewhat destroys the user experience by not opening the page in a popup.


 * Thanks! :) 80.149.87.126 08:49, 18 March 2013 (UTC)


 * That's an interesting idea, but I'd say it's outside the scope of Semantic Forms. Yaron Koren (talk) 12:16, 18 March 2013 (UTC)

Form to create Google map with multiple markers
Dear Yaron,

I'd like to set up a semantic form to create one Google map with multiple markers and - if possible - separate labels for each marker.

I have managed to put together a form that creates one map with one marker and I also added an additional text field for defining a label for that marker. I could also make this map template "multiple" but of course this adds more maps rather than additional markers inside one map. Could you give me a hint how to tackle this?

Many thanks!

--Sochin67 (talk) 20:36, 17 March 2013 (UTC)


 * I don't fully understand your setup, but you could have the multiple-instance template store the data, and the "main" template (if there is one) query that same data, and display it in a map. Yaron Koren (talk) 20:49, 17 March 2013 (UTC)


 * Hi Yaron, I thought it wasn't a good idea to store and query data on the same page, because the query might not produce the right result? --AdSvS (talk) 11:46, 18 March 2013 (UTC)


 * It should be fine - the issues only come if you then try to store those query results. Yaron Koren (talk) 12:14, 18 March 2013 (UTC)

use dropdown broken on input type category?
Hi Yaron,

input type category will not show up as a dropdown using SF 2.5.1 on SMW 1.8.0.2 and MW 1.20.2. only shows up as category tree. Is this a bug, or do I need some more configuration? Additionally: Is it possible to use show on select on a category tree using dropdown? Thanks for your support!

Kind regards --80.149.87.126 09:05, 18 March 2013 (UTC)


 * You just need to upgrade - that feature was only added in SF 2.5.2. I don't know if "show on select" will work with it, actually... Yaron Koren (talk) 12:12, 18 March 2013 (UTC)


 * Thanks Yaron - that did it. I didn't see, that it has just been added recently. I tried show on select, and it does not work out of the box, maybe, it can be added in the future? --80.149.87.126 13:30, 20 March 2013 (UTC)

Dropdown menu with blank spaces
Hi Yaron,

I updated from SF 1.8.3 to SF 2.5.2 (along with MW from 1.14 to 1.19, and SMW from 1.5g to 1.8.0.4). SMW's data was repaired after the update and Semantic Drilldown seems to indicate that the new data is fine. I had several dropdown menus created with the "values from category" option that didn't show any more, but I took that as a change in functionality that I could fix that by adding "input type=dropdown" to the template. However, categories with spaces in those fields cannot be searched now. Whether I use the dropdown menu or go back to the text box, the search returns no value. Categories without spaces do work. I'm rather shocked that no one else has the same problem. It must be me doing something wrong, but I've failed to find it. My first contact with SF has been this update.

Is there anything one should do to be able to use categories with spaces in search fields?

Many thanks in advance!

Best,

Oscar


 * By "search", do you mean the standard MediaWiki search? If so, it doesn't sound like a Semantic Forms issue. Yaron Koren (talk) 12:13, 18 March 2013 (UTC)


 * No, no, I mean the query search. The "Run query" button in the form that I created. Sorry about the confusion. If I select anything with a space from a dropdown menu, "Run query" returns no result. If I turn the dropdown menu into a text box or a combo box and enter the first non-space characters of that same entry, it does return the correct results. Entries with no spaces in the dropdown menu do work as well. It really looks like it doesn't like the spaces for some reason. Thanks!

Semantic Forms with MathJax
We want to use the Extension:MathJax extension in combination with Semantic MediaWiki and we have run into an issue. I am not sure if the problem is down to Semantic Forms (Semantic Mediawiki), MathJax or MediaWiki core. It happens with the basic setup of Semantic Mediawiki with Semantic Forms and MathJax both enabled.

Setup
A clean setup on Windows Server 2003:
 * MediaWiki 1.20.2
 * PHP 5.3.8 (apache2handler)
 * MySQL 5.5.19


 * Semantic Forms (Version 2.5.2)
 * Semantic MediaWiki (Version 1.9 alpha)
 * DataTypes (Version 0.1 alpha)
 * DataValues (Version 0.1 alpha)
 * ValueFormatters (Version 0.1 alpha)
 * ValueParsers (Version 0.1 alpha)
 * ValueValidators (Version 0.1 alpha)
 * MathJax (Version 0.7)
 * Validator (ParamProcessor) (Version 1.0 alpha)

The same happens with Semantic Mediawiki 1.8.0.4 and Validator 0.5.1 and I am aware that the MathJax extension is still Beta but when we use it it can only get better.

Problem
When initiating  via the Admin functions or run an script on the server and then force the jobs to run on the server with   the following error pops up:

D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\maintenance>php runjobs.php 2013-03-18 14:13:13 SMWUpdateJob F003 STARTING Invalid marker: ¦UNIQ69b424c72473a2bf-h-0--QINU¦ Backtrace:
 * 0 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\includes\parser\StripState.php(66): StripState->addItem('general', '¦UNIQ69b424c724...', '')
 * 1 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\includes\parser\Preprocessor_DOM.php(1168): StripState->addGeneral('¦UNIQ69b424c724...', '')
 * 2 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\includes\parser\Parser.php(3411): PPFrame_DOM->expand(Object(PPNode_DOM))
 * 3 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\includes\parser\Preprocessor_DOM.php(1083): Parser->braceSubstitution(Array, Object(PPFrame_DOM))
 * 4 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\includes\parser\Parser.php(3038): PPFrame_DOM->expand(Object(PPNode_DOM), 0)
 * 5 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\includes\parser\Parser.php(1136): Parser->replaceVariables('')
 * 6 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\includes\parser\Parser.php(370): Parser->internalParse('')
 * 1) 7 [internal function]: Parser->parse('', Object(Title), Object(ParserOptions), true, true, 109)
 * 8 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\includes\StubObject.php(79): call_user_func_array(Array, Array)
 * 9 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\includes\StubObject.php(99): StubObject->_call('parse', Array)
 * 1) 10 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\extensions\SemanticMediaWiki\includes\jobs\SMW_UpdateJob.php(59): StubObject->__call('parse', Array)
 * 2) 11 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\extensions\SemanticMediaWiki\includes\jobs\SMW_UpdateJob.php(59): StubObject->parse('', Object(Title), Object(ParserOptions), true, true, 109)
 * 3) 12 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\maintenance\runJobs.php(92): SMWUpdateJob->run
 * 4) 13 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\maintenance\doMaintenance.php(110): RunJobs->execute
 * 5) 14 D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\MaintenanceWiki\maintenance\runJobs.php(122): require_once('D:\Program File...')
 * 6) 15 {main}

This does not happen when either MathJax or Semantic Forms is disabled, it works fine then but when both of them are enabled and the semantics are being updated this fault pops up in the terminal. The template  also contains a forminput call. Because I am not really a programmer I don't know where to start looking first. Does somebody know where to start? Best regards, --Jongfeli (talk) 15:21, 18 March 2013 (UTC)


 * The whole thing sounds strange - especially the MathJax part. What are the full contents of the "Machineinfo" template? I'm guessing #forminput is not the issue. Yaron Koren (talk) 15:47, 18 March 2013 (UTC)


 * Hello Yaron, yes it is strange. I narrowed it down and I think I found the "problem" but it makes not much sense to me. In the template Machineinfo there is the call:
 * The above described problem is not present when I change it to:
 * I must say that all the properties in the template use the default pipe " " except for the Editdate property. When updating the semantics, every page where there was no value for the property Editdate it halted with the above described error. After using the pipe it is possible to update the semantics with both MathJax and Semantic Forms enabled. I am not sure if a markup "fault" should cause this behavior but I assume that something is not correctly handled in either Semantic Forms or MathJax. I put a message on Dirk Nuyens his Talk page. He is the developer of MathJax. Best regards, --Jongfeli (talk) 11:48, 19 March 2013 (UTC)
 * I must say that all the properties in the template use the default pipe " " except for the Editdate property. When updating the semantics, every page where there was no value for the property Editdate it halted with the above described error. After using the pipe it is possible to update the semantics with both MathJax and Semantic Forms enabled. I am not sure if a markup "fault" should cause this behavior but I assume that something is not correctly handled in either Semantic Forms or MathJax. I put a message on Dirk Nuyens his Talk page. He is the developer of MathJax. Best regards, --Jongfeli (talk) 11:48, 19 March 2013 (UTC)
 * I must say that all the properties in the template use the default pipe " " except for the Editdate property. When updating the semantics, every page where there was no value for the property Editdate it halted with the above described error. After using the pipe it is possible to update the semantics with both MathJax and Semantic Forms enabled. I am not sure if a markup "fault" should cause this behavior but I assume that something is not correctly handled in either Semantic Forms or MathJax. I put a message on Dirk Nuyens his Talk page. He is the developer of MathJax. Best regards, --Jongfeli (talk) 11:48, 19 March 2013 (UTC)

Form adds '}' on each save
Hi Yaron,

I have a pretty big form (there are about 60 fields in several templates). The problem is that each time that I edit a page with the form, it adds a '}' and several newline chars at the end of the page. So, if I edit it n times, I get n '}' (and newlines as well). I haven't figured out why. I dont think it is a typo in the templates (it wouldnt accumulate the '}'). I would appreciate any help :) Thanks in advance.

Benjamin. --201.217.136.181 16:20, 18 March 2013 (UTC)


 * That sounds very bad. Could you try to duplicate this problem on a public wiki, like http://scratchpad.referata.com? Yaron Koren (talk) 18:17, 18 March 2013 (UTC)


 * Well, we found the error finally. It was a typo! We had an extra '}' in a field declaration in the form:

... } ...
 * that went into the invocation of the template, and resulted in the described behavior. Thanks for the quick response and your great work :)


 * Cheers, Benjamin.