Extension talk:Page Forms

Is there a way to query field values in Semantic forms?
Hi everyone,

Im making a small php app, which has to get the field values of an specific page, for an specific Semantic form.

Is some way to do that? I've been looking the mediawiki API (api.php), and I cant find a query that covers my needs.

I would need something like

api.php?action=query&title=PAGE_TITLE&form=SEMANTIC_FORM_NAME&format=json

Is there any possible way to do this?Many thanks in advance.

Sub-Form of Semantic Forms
Hey, dear All

Is there any possible to build a Sub-Form inside Semantic Forms? Or, can we create a Sub-Property which belongs to a Property?

Right now the case is, we want to create a Form, and for Property A, there is no direct content for A, but A has for Sub-Properties, A1,A2,A3 and A4, and we need to input content into A1-A4.

Is there any possible way to do this?Many thanks in advance.


 * I'm not sure I understand your question - but "show on select" might be helpful here. Yaron Koren (talk) 16:50, 5 March 2012 (UTC)


 * Many thanks, as your suggestion, I use the "mutiple template" and it seems to fit with our target, but still we need to talk about it tomorrow.


 * But many thanks anyway, for every help!!

Weirdness using "button" formlink
For some reason when I try to use any formlink with type BUTTON, it doesn't work but instead the popup only loads the main page of the wiki. Weird thing is that I've checked the form action and it is indeed the correct string (even pasted it in to ensure that it would bring me to the right form entry). Just tested this on SF 2.4 (fresh download) and MW 1.17. Thinking back, this actually broke a while back. Maybe I posted here already? Not sure. Weird! It might be conflicts if nobody else is experiencing this. Thorncrag   20:10, 5 March 2012 (UTC)


 * Don't know about the release version. Just tried it on an MW 1.17 with the current dev version of SF and it worked alright. Maybe give it a try. There were several changes in the handling of parser functions. --F.trott (talk) 20:19, 5 March 2012 (UTC)


 * I had the same issue. Then I changed from the default method Mediawiki URLs to more friendly URLs, i.e. example.com/wiki/Page_Name. When I did that, formlinks worked. To do this,

RewriteEngine On RewriteRule ^wiki/(.*)$ /index.php?title=$1 [PT,L,QSA] RewriteRule ^wiki/*$ /index.php [L,QSA] RewriteRule ^/*$ /index.php [L,QSA] --70.91.187.57 18:35, 13 March 2012 (UTC)
 * 1) Add the following line to your LocalSettings.php: $wgArticlePath = "/wiki/$1";
 * 2) Then create a .htaccess file (if not there) in your wiki's root directory, and add:
 * Careful if you already have a .htaccess file. Cavalierly, modifying this file can cause issues with your wiki.

Lingo Extension
Hi. I have started using Semantic Mediawiki 1.7.0.2 wit Semantic Forms 2.3.2

If I have words or phrases in Field names that are on a page called Terminology and used by the Lingo Extension then the extension is interfering with the rendering of the "Edit with Form" page. The inserted Spans are a problem.

I will have to be careful with my terminology!


 * Fixed in the dev version of SF on SVN. --F.trott (talk) 22:57, 5 March 2012 (UTC)


 * Sorry to say, not fixed. See Lingo Talk Page Jeremy.Osborn (talk) 09:28, 24 March 2012 (UTC)

Preloading data into multiple instance template
What preload data into form with multiple instance template? --Pastakhov (talk) 10:24, 6 March 2012 (UTC)


 * If I understand the question correctly - you need to add another index in the query string; see here for one example: http://discoursedb.org/wiki/Special:FormEdit/Item/Some_Item?Opinion[Topic][1]=ABC (sorry, it was too hard to make it a link). Yaron Koren (talk) 01:52, 9 March 2012 (UTC)


 * Rectification: Some_Item?Opinion[index][FieldName]=ABC http://discoursedb.org/wiki/Special:FormEdit/Item/Some_Item?Opinion[1][1]=Topic1&Opinion[1][2]=Position1&Opinion[2][1]=Topic2&Opinion[2][2]=Position2  In form Item Field name not Topic, field name is 1. Thanks for help --Pastakhov (talk) 05:05, 19 March 2012 (UTC)


 * BUG: by link http://discoursedb.org/wiki/Special:FormEdit/Item/Some_Item?Opinion[1][1]=Topic1&Opinion[1][2]=Position1&Opinion[2][1]=Topic2&Opinion[2][2]=Position2 show two "Opinions...", but "Save page" set only one (last) "Opinions..." --Pastakhov (talk) 07:50, 29 March 2012 (UTC)


 * Yes, thanks :-) --Pastakhov (talk) 06:40, 9 March 2012 (UTC)


 * What move data from one multiple instance template to another? Or what get row index in #ask: query? --Pastakhov (talk) 16:24, 13 March 2012 (UTC)


 * I didn't understand the first question, but for the second question, you should store that information using the Semantic Internal Objects extension. Yaron Koren (talk) 17:27, 13 March 2012 (UTC)


 * I have page with multiple instance template. In template i use Semantic Internal Objects. I need button to copy data from this page to new page.

Template:Test
 * tmpl[fld1][ -= need get row index =- ]=
 * tmpl[fld2][ -= need get row index =- ]=

what get row index from #ask: query? mainlabel returns #rowindex. How to get rowindex without # ? Or any ideas, thanks... --Pastakhov (talk) 03:43, 14 March 2012 (UTC)


 * Getting the index is indeed tricky - the NumerAlpha extension might help. Yaron Koren (talk) 12:24, 14 March 2012 (UTC)


 * it needs used additional template, for get one index to several rows. NumerAlpha extension may help, but it looks ugly and difficult to. It would be great to have the column "index number" in #ask:.  many thanks --Pastakhov (talk) 13:13, 14 March 2012 (UTC)


 * I solve similar problems by using Extension:Arrays, and some advanced MediaWiki template programming to handle counting custom formatted SMW data. You can see an example I'm working on here: http://www.coincompendium.com/w/index.php/Sandbox/eBay_sighting_list_test Badon (talk) 21:28, 14 March 2012 (UTC)


 * In sample: {{#vardefineecho: mycounter | {{#expr: {{#var: mycounter }} + 1 }} . Thanks, --Pastakhov (talk) 05:05, 15 March 2012 (UTC)

fancybox not being loaded by form pages
I am having trouble with uploading files in my forms. Fancybox.js does not seem to be loaded with the page. I am running mediawiki 1.18 and SF 2.4.1 at first i thought it was a problem with resource loader but i saw SF is on the list for "Resource loader compatible extensions". If it's not showing up on the page, how do i go about tracking down the problem? Can i manually load it somehow?


 * I have no idea - are you using a skin other than Vector? Or are you using some other extension that might be interfering with the Javascript? And what version of Semantic MediaWiki are you using? Is this a public wiki, by any chance? Yaron Koren (talk) 01:28, 9 March 2012 (UTC)

Mediawiki 1.18 semantic forms 2.4.1, here is an example page, i have enabled editing for anons so you can see what i'm talking about. PlantWiki. I use a custom skin based off Monobook (pretty much only css has been changed). I'm a LAMP developer and don't have much experience tracing javascript so i'm a little lost. Thanks for the help!


 * Ah - the fact that it's a public wiki is extremely helpful. Your problem is a Javascript error, coming from this file. (I've never heard of the "JavaScript" extension before.) And you're using version 1.7.0.2 of Semantic MediaWiki, by the way. Yaron Koren (talk) 11:56, 11 March 2012 (UTC)

Your amazing, thanks for the support! I'm pretty sure your the only dev i have seen with this kind of commitment to helping those using their extension. Much appreciated.


 * Agreed! Badon (talk) 19:47, 13 March 2012 (UTC)

Text box too large
Hello everyone, I'm having trouble enlarging or shrinking a text box (not a textarea) size. I tried using 'size=' parameter but it just remains the same. I have also tried using different browsers but the outcome is still the same. Please help.


 * What's the full tag you have? Yaron Koren (talk) 19:31, 9 March 2012 (UTC)

That would be where hydrogen is the name of the property. Thanks again


 * Try removing the quotes around "1". Yaron Koren (talk) 13:30, 13 March 2012 (UTC)

Oh it works perfectly now! Thanks Yaron!

request: wikieditor textarea size
Since textareas where editor=wikiEditor are contained by the wikiEditor UI and we thus don't appear to have control over the wikiEditor container size, it would seem logical to disable the number of columns and disable setting width to 'auto' when editor=wikiEditor. Thoughts?


 * Nevermind, I found that [[Media:Screenshot 1.png|this]] happens when the textarea is set to autogrow. When autogrow is taken off, the textarea fills the wikiEditor space.

Are you using WikiEditor with forms? I know a lot of people have been asking about this but Yaron has mentioned it's currently not possible.


 * When did I say it wasn't possible? It's been possible since version 2.3. Yaron Koren (talk) 11:56, 11 March 2012 (UTC)

Problems editing a page
I would like that the tab "Edit with form" shows up in every page. So, I created the page "MyWiki:Main" (but changing with my wiki's namespace) with the content Page has default form::form-name.

Am I doing something wrong?

Also, when I'm editing a page, it doesn't show the real source and I really like to edit the source.

For example, the source is: Name: ABC

When I try to edit it shows:


 * For the first question - it should be "Has default form", not "Page has default form". For the 2nd question - that is the real source. Maybe you should read up more about MediaWiki templates. Yaron Koren (talk) 11:57, 11 March 2012 (UTC)

Category select depth
I have the following code in a form:.

However, there seems to be an issue in that I can only select categories up to depth 1. I am able to expand categories to view subcategories of them, but I can't tick the box next to a subcategory, rendering them slightly pointless.

Considering the large number of categories (and especially subcategories) my project has, that is annoying. Is there any way to fix it? Dendodge (talk) 00:49, 12 March 2012 (UTC)

Dynamically extend form
Hi,

I try to do the following: I have a base form/template ("Job") and I want to extend the base form with a specific other template depending on the selection of a "Job type" list box. This already works with:

I have two  section in my form (with id "jobtype_website" and "jobtype_application"). These two DIVs contain a complete form specification.

Now, when I save the form, both template definitions are included into the final page, even the one that was not visible in the form. Is it possible to create a template definition only when the DIV containing the form is visible? Or when a specific field inside the extended form is filled?

Or, as an alternative solution: Is there a possibility to limit the "multiple" form to allow only 0 or 1 forms?

Thanks. Jens--157.161.162.66 15:10, 12 March 2012 (UTC)


 * Hi - being able to limit the number of instances of a multiple-instance template might have been a reasonable solution here, but unfortunately it can't be done. What's so bad about having the extra, unused template in the page, though? If the issue is that it's displaying some header that you don't want it to, you can get around that by using #if to only show the header when necessary. Conversely, you don't need even need three templates - you can have everything in one big template, again using #if to only show the relevant parts each time. Yaron Koren (talk) 17:02, 12 March 2012 (UTC)

Dynamically show listbox entries depending on selected value of other listbox
Hi,

as described in the title, I have to listboxes. The first one shows the main category. Now depending on the selected values (one or more are possible), I want to show different values in the second listbox. I tried the "values dependent on" parameter but it didn't work out and I couldn't find a description in which way it should be implemented.

Or can it be easier to realize with an ask query?

Hope someone can help. Thanks, Chris


 * Unfortunately, this can't really be done. As noted in the documentation, "values dependent on" only works with the input types 'combobox', 'text with autocomplete' and 'textarea with autocomplete'. You might be able to do mimic this using "show on select", but note that each "shown" field would have to have a different name. Yaron Koren (talk) 13:43, 13 March 2012 (UTC)

Issue with Edit with Form
I have put 2.4.1 on my IIS 7.5 wiki and I get the following error:

"PHP Fatal error: Class '<' not found in D:\www\IIS7\http-root\ict-test-wiki\extensions\SemanticForms\includes\forminputs\SF_FormInput.php on line 308"

Product Version MediaWiki 1.18.1 PHP 5.2.17 (cgi-fcgi) MySQL 5.5.11

Semantic extensions Semantic Bundle (Version 20120124) Semantic Forms (Version 2.4.1) Semantic Forms Inputs (Version 0.5) Semantic MediaWiki (Version 1.7.0.2) Semantic Result Formats (Version 1.7)

Can someone help and suggest where I might be able to fix things?

Thank


 * Hi - this looks like a bug in SF that's appearing due to your PHP version, and possibly due to IIS as well. If possible, to help us in fixing it, could you add the following line between lines 304 and 305 of that file (\includes\forminputs\SF_FormInput.php);

print_r( $bt[1]['args'] );
 * ...and print out here what gets displayed? Yaron Koren (talk) 13:31, 14 March 2012 (UTC)

I'm getting the exact same error on a linux server. MediaWiki 1.18.1, PHP 5.2.17 (cgi-fcgi), MySQL 5.1.56, Semantic MediaWiki 1.7.1, Semantic Forms 2.4.1 Output after adding 'print_r( $bt[1]['args'] );' Array ( [0] => Array ( [0] => SFTextAreaInput [1] => getHTML ) [1] => Array ( [0] => [1] => Test Template[Name] [2] => [3] => [4] => Array ( [possible_values] => Array [value_labels] => [is_list] => [semantic_property] => Name [property_type] => _txt ) ) ) Array ( [0] => Array ( [0] => SFTextAreaInput [1] => getHTML ) [1] => Array ( [0] => [1] => Test Template[Address] [2] => [3] => [4] => Array ( [possible_values] => Array [value_labels] => [is_list] => [semantic_property] => Address [property_type] => _txt ) ) ) Array ( [0] =>  {| class="formtable" ! Name: |  |- ! Address: |  |}  Free text:   [1] => [2] => [3] => 229 [4] => [5] => Radge [6] => ) Fatal error: Class '<' not found in /home/rellard/public_html/www.ecig-boxmods.com/extensions/SemanticForms/includes/forminputs/SF_FormInput.php on line 309


 * Okay - it must just be PHP 5.2, then. This is clearly a pretty major bug. Yaron Koren (talk) 17:01, 16 March 2012 (UTC)

If it's any help I can probably upgrade my hosting to PHP 5.3 to see or would that cause more problems? Done, It's fine now with PHP 5.3 Thanks a lot :)


 * Hi - this was just fixed in SVN by Stephan Gambke; if anyone has this problem and has SVN, just update the code. If you don't have SVN, you can make the change manually - see here. There will hopefully be a new version of SF with this fix, soon. Yaron Koren (talk) 19:59, 16 March 2012 (UTC)

Multiple values for a template
Hi all,

Relative at this example

Give a type:

I don't know if it's a bug but when I was using Semantic Forms 2.4-alpha it worked well. But when I upgraded the new version Semantic Forms 2.4.1 I can't edit a page using this Form

best regards, Fary


 * What do you mean - why can't you edit the page? Yaron Koren (talk) 15:12, 14 March 2012 (UTC)

If I edit a page I have a blank page.


 * Ah - please see here. Yaron Koren (talk) 16:35, 14 March 2012 (UTC)

I increase my memory at 128M and if I put in my LocalSettings error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); It shows Fatal error: Call to a member function getOutput on a non-object in ..../extensions/SemanticForms/includes/SF_FormEditAction.php on line 179 instead of the edit page


 * Cool, thanks. You've found a bug - thankfully, it seems that it only appears when there's more than one form defined for a page. Also, I'm guessing that you're using MediaWiki 1.17. Anyway, I just checked in what I think is a fix - if you have SVN, please update, and let me know if that fixed the problem. Yaron Koren (talk) 13:41, 15 March 2012 (UTC)

I'm using MediaWiki 1.17.0 but the problem is the same


 * You updated Semantic Forms? What's the error message you're getting now? Yaron Koren (talk) 17:42, 15 March 2012 (UTC)

Error message is the same: Fatal error: Call to a member function getOutput on a non-object in ..../extensions/SemanticForms/includes/SF_FormEditAction.php on line 179 when I use Semantic Forms 2.4.1 with MediaWiki 1.17.0 but if I use Semantic Forms 2.4-alpha there's not problem


 * You must have somehow not updated SF fully - at the very least, you should have gotten a different line number. Yaron Koren (talk) 11:58, 16 March 2012 (UTC)

Yeah! it's working now. May be my update wasn't complete. Thanks Yaron


 * It's great to hear that the fix worked. Yaron Koren (talk) 16:04, 16 March 2012 (UTC)

Forms fail after updating to latest Semantic Bundle
I just updated to the latest Semantic Bundle and get the following when I try to Edit with form:

Fatal error: Class '<' not found in /home/content/65/6092565/html/scientolipedia/extensions/SemanticForms/includes/forminputs/SF_FormInput.php on line 308

The line 308 is:

$input = new $calledClass ( $sfgFieldNum, $cur_value, $input_name, $is_disabled, $other_args );

Thanks in advance for any help. DaveL (talk) 14:41, 16 March 2012 (UTC) MediaWiki 1.18.0,PHP 5.2.17 (cgi-fcgi),MySQL 5.0.92-log, Semantic Bundle (Version 20120308)


 * This bug was already reported, above (I assume it's due to the use of PHP 5.2). IIf possible, could you try the debugging call, as I suggested above? Yaron Koren (talk) 15:15, 16 March 2012 (UTC)


 * The printout is here DaveL (talk) 16:07, 16 March 2012 (UTC)


 * Thanks for the printout; that was helpful. This problem has been fixed in SVN; see above. Yaron Koren (talk) 20:00, 16 March 2012 (UTC)


 * Thanks Yaron, that fixed it. DaveL (talk) 21:01, 16 March 2012 (UTC)

Sizing Image For Display On Form
SF 2.3.2/MW 1.18:  I am wanting to have the form display a given size for the image that I upload (e.g.; 200x200). Is this possible and if so how would I do it? Thanx! --Coffeehound (talk) 21:36, 18 March 2012 (UTC)


 * That's not really possible, unfortunately - right now the size is hardcoded, so the only way you could change it is by modifying the file /libs/SF_imagePreview.js (where, ironically, the width is right now set to 200 pixels). Ideally, this should be a user setting. Yaron Koren (talk) 13:26, 19 March 2012 (UTC)


 * All good! I really love the extension and thank all of you for putting your time into these things and answering ?s from folks like me!   With that said, I changed the 200 to 100 to see if it did anything and nothing happened.  The photo is displaying at 640x480 (which is the size that it uploaded at).  You may see it at http://offgridops.org/foreclosurepedia/index.php/1772077367  (I have taken the security down for a day and will have to reinstate it after a bit as it is a US Government real estate asset).  Thanks, in advance, for any help!--Coffeehound (talk) 19:50, 19 March 2012 (UTC)


 * Hi - oh... I think you're talking about the display of the image on the page, not on the form. It's important to note that, once a page has been created with a form, Semantic Forms has no control over its display or behavior. To change the image size, see here. Yaron Koren (talk) 21:40, 19 March 2012 (UTC)


 * Thank you for a quick reply. Yes, you are correct; I am referring to the page created as an end product of the form.  So, to make sure I understand do I need to: a) ensure that the size of photos to be used are uploaded at the size I want; or b) am I able to set the size in the template?  The template is ! Main image | Has image::Image: [[Image:]] |-  I added |100px in both areas after Main image| and got no change in the size of the photo on the page.  Thanx! --Coffeehound (talk) 23:12, 19 March 2012 (UTC)

Multiple image uploads per form
My first image is within an infobox and displays fine after uploading using in the template. Using the same method further down the template 250px just causes a red link to appear.

I'm really stuck. Do I need to define an arraymap and if so can you give me some help please?


 * You just need to change the 2nd one to [[Image:|250px]] . Yaron Koren (talk) 13:27, 19 March 2012 (UTC)

Thanks Yaron


 * Sometimes you just need a second set of eyes to look at what you're doing :) Badon (talk) 03:46, 30 March 2012 (UTC)

fatal error using SF 2.4.1
I ran into the following error:

PHP Fatal error: Class '<' not found in /SemanticForms/includes/forminputs/SF_FormInput.php on line 308


 * Hi - yes, that bug has been fixed in SVN (see above). I hope to release a new version with the fix very soon. Yaron Koren (talk) 15:08, 20 March 2012 (UTC)


 * Sorry, I didn't see the previous post. I did SVN update (to revision 114383) and it solved that problem.  However, I'm noticing this now:

PHP Fatal error: Class name must be a valid object or a string in /SemanticForms/includes/forminputs/SF_FormInput.php on line 313, referer: 

line 313 shows: $input = new $calledClass ( $sfgFieldNum, $cur_value, $input_name, $is_disabled, $other_args );

This error is being thrown when calling Special:FormEdit.

If it would help to know, the page name is being created by the form's one-step process. 'Info' tag follows the pattern:


 * That's bad... if possible, could you put in that same print_r call, described above, and let me know what that prints out? Yaron Koren (talk) 18:50, 21 March 2012 (UTC)


 * exact print_r output (retaining original template & property names):


 * Hi - thanks. Unfortunately, that's not enough to diagnose the problem. Could you change that print_r statement to just be "print_r($bt)", and then email me the results, at yaron57@gmail.com? It'll probably be too huge for this page. Yaron Koren (talk) 13:18, 22 March 2012 (UTC)

Fatal error: Class '<' not found
QUICK SOLUTION: Upgrade semantic forms to 2.4.2

MW 1.18.1/SF 2.4.1

Fatal error: Class '<' not found in /home/offgrido/public_html/onyx/extensions/SemanticForms/includes/forminputs/SF_FormInput.php on line 308

Absolutely nothing in the wiki except a new form.

Any help would be great! --Coffeehound (talk) 23:02, 20 March 2012 (UTC)


 * I ended up redoing the SMWAdmin and it seems fine. Sorry for the bother.  You can delete this if you want. --Coffeehound (talk) 23:12, 20 March 2012 (UTC)

I'm having the same issue, but updating the database tables doesn't fix it - what did you mean by 'redoing the SMWAdmin'? (29 March 2012 (UTC)


 * I don't know what that person meant, but if you upgrade to SF 2.4.2, the problem should go away. Yaron Koren (talk) 16:47, 29 March 2012 (UTC)

I can confirm: I had same issue with Mediawiki 1.18.2 and SF 2.4.1. Now by downloading SF 2.4.2 I could fix this issue. Thanks for the tip and the correction! Thomas →10:27, 31 March 2012 (UTC)

initialize hidden field after query
I'm using MW 1.18 / SF 2.3.2

I have a form with a field (hidden in my case) for a query page. The query returns with links to run the query with some values for that field (i.e. RunQuery/Querypage&Querypage[hiddenfield1]=2&...). So my problem is that I need to initialize the hidden field value after the query page data is loaded. Is there a built-in way to do this? to initialize a field value to its default after query processing? Osishkin (talk) 14:46, 21 March 2012 (UTC)


 * Unfortunately, I don't think so... why do you need a hidden field, though, for a query form? Yaron Koren (talk) 15:33, 21 March 2012 (UTC)


 * In my case I return a paginated table in response to the query. I obviously can't know the number of pages returned before the query is executed, So even if I wanted (and I don't, it's ugly) I can't display a "Choose results page number" combobox.


 * The solution I've chosen is to maintain a hidden field with the page number. However, I now realized this raises a bug - if the user queries with page=2, and afterwards decides to run a completely different query, the page number in the hidden field is still maintained. The new query may not even have 2 pages of results, and the result may be null. Osishkin (talk) 16:35, 21 March 2012 (UTC)


 * If you can demonstrate the issue for me, I might be able to suggest a better solution. Can you share a link to an example? Badon (talk) 03:49, 30 March 2012 (UTC)


 * Well I can try, but my wiki is in Hebrew, so you might have to make an effort. This link is for a RunQuery page where the user asked for page 3 of detailed results table (if you look at the URL you can also see the relevant parameter). The result is composed of three parts - general overview (non-paginated), detailed overview (paginated) and on the bottom you see the actual form. If you now replace the text in the first top right input box to הפועל לוד, and run the query - you now see a non-empty general overview table, and an empty table in the second part. Using printouts I figured out that the hidden field is still set for 3, which is obviously not relevant for the new query result, and messes up the paginated second part. Hope you got the idea. Osishkin (talk) 07:29, 9 April 2012 (UTC)

Upload not inserting images into forms
Using upload in a form input i get the normal upload window, select the file to upload, and see the filename appear in the upload window. Although i see the loading bar appear for a second, there is no image preview and when i click "upload" the upload window goes blank, does not close, and no image appears in my form (no image or filename inserted into the input box). However, the image has been uploaded to the wiki when i check my recently uploaded files. You can view the problem here and use the following login info...

Username: user Password: password

Thanks!


 * The issue is a Javascript bug coming from outside Semantic Forms - see the 5th item here. Yaron Koren (talk) 20:17, 22 March 2012 (UTC)


 * When i add the debug URL i get an error. How should i append the debug command to the formedit URL?


 * You should add "&debug=true", not "?debug=true", to the URL. Yaron Koren (talk) 00:27, 23 March 2012 (UTC)


 * I get an error saying MW user is undefined. Here is the line it references in my page code..

if(window.mw){ mw.user.options.set({..... (let me know if you want to see all of this it's a half page) }

Now the weird thing is i turned off my extensions i had added since i last had it working. Then turned them back on. Images now show in the form and upload correctly but there is no preview image in the upload window. It previewed once out of 5 times i uploaded. The bug seems intermitten but i'm not changing things each time i try.


 * Well, whatever the cause is, I believe it's not related to Semantic Forms. Yaron Koren (talk) 16:45, 23 March 2012 (UTC)


 * Actually, if I understand the description of the issue correctly, I think it is related to SF. If the user tries to upload a file before SF's JavaScript fully loads, the upload will succeed, but the uploaded file will be "lost", just like was described by the person above. The solution to Bug 32424 might also solve this problem. Basically, the upload field and link should only be shown in certain circumstances. By using JS to display it, the user will have to wait for the JS to load before they can use it. Badon (talk) 04:01, 30 March 2012 (UTC)

embed in field question
In a template (escaping all), I have &#123;&#123;&#123;for template&#124;^page&#125;&#125;&#125;&#123;&#123;&#123;field&#124;header&#124;holds template&#125;&#125;&#125;&#123;&#123;&#123;end template&#125;&#125;&#125; and later &#123;&#123;&#123;for template&#124;^header&#124;embed in field=^page[header]&#124;multiple&#125;&#125;&#125;

No button is shown for adding instances of the ^header template; before I added this code into the form the button was showing and operating fine. Instead I now see displayed:   Any ideas? I have 2.4 SF + 1.6 SMW + 1.17 MW.

I tried this feature because I want to specify default templates for the "header" field by something like

Will I be able to get this to work or is there a another way. --Hypergrove (talk) 08:43, 26 March 2012 (UTC)


 * My guess is that this is failing due to the "^" in the template name (which would be a bug). Is this happening on a public wiki? If not, is there any way you could reproduce the problem on a public wiki, like scratchpad.referata.com? Yaron Koren (talk) 13:28, 26 March 2012 (UTC)


 * removed the 'hat' symbol and the code is behaving differently, not correctly yet. It is placing the add-another-button at the position of the template that embeds the repeating template, not within the scope of the repeating template as it did prior to my inserting this code. I assumed the formatted form would NOT look any differently, that the 'embed in field' for-template would still generate its button at the point that that for-template is located, NOT at the point of the field that contains the 'holds template'. I am not able to rearrange the for-templates to accommodate this (unexpected?) layout becuase my form is now organized as  . I was trying to request SF to format the following template invocation in the page:


 * And is there a way to specify a default template instance that is embedded in the field marked as "holds template"? thanks, --Hypergrove (talk) 19:21, 26 March 2012 (UTC)


 * Well, right below where the multiple-instance templates are is where the "Add another" button should go, no? It just seems weird to have it anywhere else - you press a button and something pops up in some other location on the page. For your last question, preloading the form with content might achieve that. Yaron Koren (talk) 19:45, 26 March 2012 (UTC)


 * yes, I agree that's where they should go, but it's not happening... I have set up a demo of my system right now, without using the embed feature, just plain multiple templates being displayed by a form template. At this point, the add-another button is no longer shown, the legend of an instance fieldset IS shown but at the top of the form, the cancel button doesn't work now and so on - it's just all wrong! Thanks so much for your looking at this Yaron.


 * Hi - well, now everything is starting to make more sense. This is a complex form! It contains form templates, and there's a lot going in every component. This is too much for me to analyze right now - I would try simplifying the form to try to isolate the part(s) causing the problem. You could start by just using the "mw-collapsible" class instead of the "^collapsible" template. By the way, scratchpad.referata.com is the general testing wiki, not smw.referata.com - it's fine, though. Yaron Koren (talk) 13:01, 27 March 2012 (UTC)


 * Sure - i've removed all unrelated code at a demo of my system. It's much shorter now, just for template - field - end template are escaped in ^form Thanks --204.16.43.16 06:08, 28 March 2012 (UTC)


 * Great - but now it's working, no? Yaron Koren (talk) 10:21, 28 March 2012 (UTC)

forminput - entry mandatory
Is it possible to make an entry mandatory in the forminput field? This will keep the form from loading with no page name or only a super page name. --Dgennaro 18:58, 26 March 2012 (UTC)


 * That's probably a good idea - it would require some Javascript. Yaron Koren (talk) 19:11, 26 March 2012 (UTC)

form preloading question
If I have a multiple template in a form, I don't see how to to preload a page with an instance of this template. There's the preload arg on the free form text field, but I don't see how that can be a solution, particularly when that 'field' is said to be include-only content. I don't quite see how a multiple template can be instantiated by providing a preload arg to the free-form field (does the design basically rely on a side effect?). Thanks for guidance. --204.16.43.16 19:12, 28 March 2012 (UTC) ...Reading older posts, it seems there's no way yet to preload instances of a multiple template (as opposed to preloading values within a multiple template). Embed in field and holds template I thought would work (and then givng a default value for the "holds template" field but the add-another button is not being created or formatted correctly.


 * This definitely could be documented better, but there's a way to do it: instead of "templateName[fieldName]", you have things like "templateName[fieldName][1]". As for the template-embedding thing - please let me know if you think you've found a bug. Yaron Koren (talk) 21:14, 28 March 2012 (UTC)


 * Oops - that should actually be "templateName[1][fieldName]". Yaron Koren (talk) 12:38, 29 March 2012 (UTC)

RunQuery - transclusion of categories field
I noticed today when you transclude a RunQuery page onto another page an it contains a "categories" field that the categories will appear to be all top level categories even if they are nested. --Dgennaro 20:07, 29 March 2012 (UTC)


 * Do you have a demo for that? Badon (talk) 04:07, 30 March 2012 (UTC)

BUG: incorrectly saved page with preloading data into multiple instance template
sample link http://discoursedb.org/wiki/Special:FormEdit/Item/Some_Item?Opinion[1][1]=Topic1&Opinion[1][2]=Position1&Opinion[2][1]=Topic2&Opinion[2][2]=Position2 show two row in "Opinions for this item", but page save only one (last) row --Pastakhov (talk) 07:09, 30 March 2012 (UTC)

Multiple-instance embedded template with header tabs
Hi, it seems that this combination may not be working. This is part of a form definition: = Channels =

It works fine without the 'multiple'. Than there is a 'Channels' tab in the form with the field 'Channels'. But with the 'multiple' the 'Channel' tab is empty and the multiple part with the 'Channel' field appears outside the tab-range.

Or am I doing something wrong? --AdSvS (talk) 09:12, 3 April 2012 (UTC)


 * Can you duplicate this problem on a public wiki, like scratchpad.referata.com? Yaron Koren (talk) 14:56, 3 April 2012 (UTC)

Multiple Parameter Not Working
Hello, the SF 'multiple' parameter is not working on my installation. We use MW 1.17.

On an archive page I found the same topic with MW 1.16. - he said it would work with MW 1.17.... But not in my wiki :-(

I only see the Button "add another", but I can´t click it. What can I do? Cheers, Mediawikitester (talk) 11:50, 3 April 2012 (UTC)


 * I assume there's some unrelated Javascript error happening - please see the 5th item here. Yaron Koren (talk) 14:57, 3 April 2012 (UTC)

Hello World not working
Hello,

I try to run the following 'Hello World' to restrict properties to allowed values. I should see a field, that restricts the values to these values. In fact it shows a single-line textfield. Can anyone please help me?

Template:Testvorlage
Blub

Seite bearbeiten

Form:Testformular
Testattribut:

Property:Testattribut
Has type::Type:String.


 * Allows value:=Wert1
 * Allows value:=Wert2


 * Hi - Semantic Forms' template parsing (where it tries to associate between template fields and properties) is not perfect - in this case, it could be the extra space in the #set call that's messing it up. If that happens for any reason, you can always hardcode the relationship by adding "|property=..." to the "field" tag in the form definition. By the way, your property page is using very old syntax - that might be the cause too. I would suggest recreating the property using Special:CreateProperty. Yaron Koren (talk) 13:44, 10 April 2012 (UTC)


 * Thank You! I changed the Property:Testattribut to the latest style

Has type::String


 * :Wert1
 * :Wert2

Field definition in Form:Testformular ist changed to

And #set in Template:Testvorlage is changed to

This is not working.

Declaring the allowed values directly with the field like works fine. I asume this is not the recomended way, as you cannot reuse the value set.

Any hint?


 * That's very odd - the generated property page should have "Allows value::Wert1", etc. I can't duplicate that problem, but if you add in "Allows value" to the property page, it should work. Yaron Koren (talk) 15:40, 10 April 2012 (UTC)

"Values dependent on" explanation
Can someone add an explanation of the new "values dependent on" feature (add in v2.4)?

Does this feature allow us to specify a SMW query based on the value selected in another field? How is the dependency defined?


 * It's already explained in the documentation, but the explanation could probably be a little more verbose. No, you can't specify a query - the querying is done automatically. The classic use case for it is that, if the user selects a certain value for a "Country" field, the "City" field will then only autocomplete on values that already exist on the wiki on pages with that value for "Country". If that makes sense. Yaron Koren (talk) 15:10, 12 April 2012 (UTC)

BUG: question marks instead of Cyrillic in Uploading filename
use form Images_test for upload file.

аватар.gif uploaded in wiki succeeded, but filename in form contain question marks instead of Cyrillic Test_cyrrilic_by_images_test--Pastakhov (talk) 07:50, 13 April 2012 (UTC)


 * Yes, I know... it's there in the "Known bugs" section. I wish it were fixed already - I spent a while looking into it, but I couldn't figure out a solution. Yaron Koren (talk) 16:12, 13 April 2012 (UTC)


 * Resolved: Remove line 386 ($basename = utf8_decode( $basename );) in file SF_UploadWindow.php. It helped me --Pastakhov (talk) 05:37, 16 April 2012 (UTC)


 * Cool - I'll look into that. I seem to recall having tried that, and that it doesn't work in all cases (i.e., that utf8_decode is sometimes needed), but it's worth examining again. Yaron Koren (talk) 16:24, 17 April 2012 (UTC)

Template in editor without breaks
How can I create a form with a template, which will show the template in editor without breaks.

Example:

My form generate this text in editor:

I want to have:

It is possible?

Greets


 * I don't think so - why do you want that? Yaron Koren (talk) 16:25, 17 April 2012 (UTC)

" and the Template is not working. Also it would be more clearly and the Text in editor would be shorter. --80.149.179.2 09:50, 24 April 2012 (UTC)
 * I need that, because we use a visual Editor. With that breaks, the editor writes automatically "


 * Is there really no chance?

Problem with input type = googlemaps
Hello,

I just installed SemanticForms, Maps and SemanticMaps. Unfortunetaly people of the SemanticMaps Forum couldn't help. The Problem is, that the map cannot be load in a semantic form via input type=googlemaps. This is the same case with yahoomaps and openlayers. There is only the sentence "Loading map form input" visible in the form and no further step is done. Also the browser isn't loading anymore. Firebug extension throws an error that the variable "lat" and "lon" is not defined, but I didn't find the code, where this is declared. My installation: MediaWiki 1.17.0_0 SMW 1.6.1_3 SF 2.2.1_1 Maps/SemanticMaps 1.0.3

I hope somebody can help.

Best regards...


 * You're apparently using versions of the code from the SMW+ package - so I think only the people from Ontoprise can help you. Yaron Koren (talk) 17:16, 19 April 2012 (UTC)

Unfortunately, they cannot help. Could you think of some reason why the map is not loading? Could this have something to do with the Resource Loader? Could jQuery be the problem? I haven't found this error anywhere else.

Cheers

Fatal error: Cannot redeclare class SFUploadWindow in /{path to wiki}/extensions/SemanticForms/specials/SF_UploadWindow.php on line 1102
Hi,

After upgrading from MW 1.17.1 to MW 1.18.2, I can no longer access the Special pages. Instead I get this error message: Fatal error: Cannot redeclare class SFUploadWindow in /{path to wiki}/extensions/SemanticForms/specials/SF_UploadWindow.php on line 1102


 * Installed software
 * Product 	Version
 * MediaWiki 	1.18.2
 * PHP 	5.2.17 (cgi-fcgi)
 * MySQL 	5.1.39-log


 * Semantic Forms (Version 2.4.2)

I also experienced a very similar issue on a different wiki several months ago:

Fatal error: Cannot redeclare class SFUploadWindow2 in (path to MediaWiki)/extensions/SemanticForms/specials/SF_UploadWindow2.php on line 1101

Fatal error: Cannot redeclare class SFUploadWindow2 in (path to file) SF_UploadWindow2.php on line 1117

Have any clues emerged since that time which might explain what's going on with this type of error?

Kind regards,
 * -Davydog (talk) 17:46, 20 April 2012 (UTC)


 * Hi - it's too bad that this is still a problem. Have you tried un-installing all the extensions except for SMW and SF? Yaron Koren (talk) 03:07, 22 April 2012 (UTC)


 * Hi Yaron. I've tried just about every combination of extension installation / uninstallation that is practical that I could think of. PortlandWiki has grown to rely on a number of the installed extensions, so I couldn't uninstall them all. Ultimately one of the other admins and I decided to uninstall the semantic extensions.

"Autocomplete on" or "values from"
I have a weird behavior in my installation. On old versions of Semantic Forms, the field attributo to autocomplete over categories, properties, etc. was "autocomplete on ...". But the new manual says: "values from ...".

I'm using version 2.4.2 ... but I need to use autocomplete on !!! values from desn't work (for me...).

Can I solve this?

Thanks. Fernando Carpani (talk) 18:30, 20 April 2012 (UTC)


 * Yes, the syntax changed - the correct approach is to have "|input type=text with autocomplete|values from...". (Or "textarea with autocomplete".) If that doesn't work, let me know. Yaron Koren (talk) 20:34, 20 April 2012 (UTC)