Extension talk:Page Forms

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)


 * 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

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
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)

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)

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)

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)