Extension talk:Page Forms/Archive May to June 2011

EditFilter Hook for popup windows
Is there an equivalent hook to the Mediawiki 'EditFilter' hook that I can use on Semantic form popups?


 * No, no hooks built in. --F.trott 22:37, 9 May 2011 (UTC)

Bug with non-english letters in category-selector?
Hello, I wanted to ask here before I submit a bug, as I'm not sure whether this is an issue with the Category Tree extension or with SF, but it seems that when using a Category-input field, the set category is not marked when editing the article again, if the category name contains any of the letters 'å', 'ä' or 'ö' (and probably more). Does anyone else experience this?

rotsee 12:05, 2 May 2011 (UTC)


 * Thanks for the bug report - I believe I just fixed that in SVN. Yaron Koren 18:35, 3 May 2011 (UTC)


 * Beautiful, thanks! rotsee 11:21, 4 May 2011 (UTC)

Using Forms to show optional Data?
Hello.

I know that the main goal of Semantic Forms is for input data... but, can I use it for display data? I want to show optional data, depending on some field. I can use "show on select" field option... but I cant use them like a normal page.

Example:

The inclusion of the graph is controlled by the "Ver Grafo" check box.

The page, doesn't have save button...

But the page, is not a "normal" page, because I can't include it. Also I can't use this things in a category page...

I'm wright ? Or there is some other solution...????

Thanks.

FDO.


 * If you want to do a "show on select" in a regular page, I don't think you can do that - collapsible tables might be helpful instead, though. Yaron Koren 18:38, 3 May 2011 (UTC)

Making edit summary a required field
This should be a fairly easy functionality to build into SF - any thoughts on how this could be accomplished? Thorncrag   00:16, 3 May 2011 (UTC)


 * It would require changing the PHP - right now there's no way to do that. It's an interesting idea for a feature, though. Yaron Koren 18:39, 3 May 2011 (UTC)

Multiple instance templates placement in template output
The multiple instance templates are absolutely great, but it seems that they insist upon outputting at the end of the template. Is there a way to allow them to be mixed in with the other elements of the template instead of at the end? For example, at the beginning of a template page. Perhaps I am doing something wrong. Thorncrag   19:47, 3 May 2011 (UTC)


 * They should show up on the page in the same order in which they appear in the form definition. Is that not the case? If so, can you reproduce the problem on a public wiki? Yaron Koren 20:44, 3 May 2011 (UTC)
 * This exemplifies what I'm referring to--is there a way to get the multi-instanced template to somehow be called from within the other template? The more I look, the less it seems that that is possible considering the way it's stored on the source page in a particular order.     Thorncrag    22:18, 3 May 2011 (UTC)


 * Ah - you're talking about one template call being embedded in another. It would certainly be helpful, but Semantic Forms can't support that, unfortunately. Yaron Koren 03:37, 4 May 2011 (UTC)
 * Perhaps I can accomplish this by nesting it within another parameter... will try that.    Thorncrag    00:13, 6 May 2011 (UTC)

Duplicate entries in autocomplete list
In our category structure, we have a toplevel category, e.g. "Contact" with several subcategories like "Contact DE", "Contact USA", "Contact Internal", "Contact External". In our forms we use the toplevel category for autocompletion. Since contacts can belong to several subcategories of "Contact", e.g. internal and DE, it apears once for the toplevel category and once for each subcategory it belongs to. Since I don't see a why this could be helpfull, could the autocomplete list check for duplicates and remove them? Tobias Rummelt 10:40, 4 May 2011 (UTC)


 * I can't duplicate that - are you using the latest version of Semantic Forms? Yaron Koren 13:51, 4 May 2011 (UTC)


 * I use SMW 2.1.2 and MW 1.16.2. Maybe I could try to reproduce it on your scratchpad. Tobias Rummelt 11:54, 6 May 2011 (UTC)


 * I could reproduce this behavior on Referata Scratchpad Tobias Rummelt 11:53, 10 May 2011 (UTC)


 * Cool, that was helpful. And now I know that you were talking about remote autocompletion. This was indeed a bug, that I just fixed in SVN. Yaron Koren 20:36, 10 May 2011 (UTC)

Fix for getting wikicode to work properly inside text fields
Perhaps it should be noted on the page that $smwgLinksInValues = true; not only allows links, but it also enables all other wikicode to function correctly inside a form field. not sure if this is intending or not, but it worked for me. Before setting that to true, wikicode in my text fields caused all sorts of issues. Cheers, Jon Povey 125.237.120.119 23:53, 6 May 2011 (UTC)


 * Feel free to add that to the documentation. Yaron Koren 04:34, 9 May 2011 (UTC)

Bug with maxlength
maxlength seems to work by restricting the number of characters the user can type into the form field. Correct? However if the user pastes text from another source, does not ever type anything in the field, and saves the form - the data is accepted, even if it is way over the maxlength setting.

Could this be changed so the check happens at submit time as well, to ensure the character limit is not exceeded?

Cheers, Jon P 125.237.120.119 00:07, 7 May 2011 (UTC)

Problem with WYSIWYG Extension
Generally the new WYSIWYG extension is better integrated with Semantic MediaWiki than the FCKeditor extension. For example the syntax of the semantic properties is not destroyed while editing a wiki page. Unfortunatelly there is a conflict with Semantic Forms. If I create a class and want to edit the new form I get the following error message:

Fatal error: Class 'FCKeditorParserOptions' not found in /var/www/mwtest/extensions/SemanticForms/includes/SF_FormUtils.php on line 398

It would be really great to get Semantic Forms working with WYSIWYG extension!

Thanks and greetings, --Filburt 17:54, 9 May 2011 (UTC)

Using WYSIWYG extension and Semantic Forms (Version 2.2-alpha)
Testing Semantic Forms (Version 2.2-alpha) (r88513) and WYSIWYG extension (Version 1.4.0_3 [B268], CKEditor 3.4.2 (revision 6041)) but as soon as is set in LocalSettings.php $wgDefaultUserOptions['riched_start_disabled'] = true; $wgDefaultUserOptions['riched_toggle_remember_state'] = true; The error Fatal error: Class 'FCKeditorParserOptions' not found in ...extensions\SemanticForms\includes\SF_FormUtils.php on line 399 occurs and while in normal edit mode the WYSIWYG extension works as describe, in form edit mode their is no toggle link (for text area) to switch to the WYSIWYG editor mode at all. --MWJames 12:20, 21 May 2011 (UTC)


 * Well, this is half-fixed now - I believe the error messages are gone, although SF still doesn't support the WYSIWYG extension - for that, you'd have to talk to the authors of the extension. Yaron Koren 22:24, 24 May 2011 (UTC)


 * From the extension authors on ontoprise:

"The 'free text' input in Semantic Forms sets a textarea that holds all the non-template text in a page. If you have the WYSIWYG Extension installed, and it shows up correctly in regular 'edit' pages, then it should show up automatically as well for the free text input."
 * I understand their point, they believe it should be straight-forward and SF (or anything else) shouldn't be getting in the way. But I took apart some of the work done to support FCKeditor in SF, and it's not trivial. Is their belief that it should just work naive?  On your side, when you say "talk to the authors", were you expecting them to create something compatible with FCKeditor?  There are portions that match, portions that are off by the letter 'f', and things completely missing, like the contents of fckeditor_config.js.


 * WYSIWYG is really a great improvement over FCKeditor and would enhance my site, but only if it worked with SF. From what I've read so far, it doesn't seem like anyone is going to budge.  Is that a true statement on your side Yaron?


 * To clarify, I'm just fishing for future support possibilities, and not purposely trying to be difficult. As always, I appreciate the great work. --Skew 06:03, 11 June 2011 (UTC)


 * Well, it's important to note that when the WYSIWYG people (i.e., Ontoprise) talk about "Semantic Forms", they're talking about their own, patched version of SF, which has better support for their other extensions. I've been working with them on synchronizing the two versions, so that they won't require any patches, but for now, you're better off talking to them about these kinds of problems. Yaron Koren

Redlink: Open Form as Popup?
When I click on a redlink I would like the form to open as popup. Is this possible? --Planetenxin 17:24, 14 May 2011 (UTC)


 * That's an interesting idea - would you want that for all red-links on the wiki, or only for certain properties? Yaron Koren 14:58, 16 May 2011 (UTC)

Is it possible to use previous/preloaded values in constructing a form?
I'm using a form to create items that have a many-to-one relation to a certain "parent page". Technically, I would have preferred to be able to create all the sub pages with a single form, but I've managed to get it done by simply adding a form-link to the parent page's edit form (only appears if the parent page was already created, using #ifexist).

Now I have a different problem. I want the sub-pages to interlink. That is, I want a field in the sub-pages' form to be pre-filled with the sub-pages for the same "parent page". The "parent page" is stored in a hidden field, so it's value can only come from pre-loaded data, or from editing an existing sub-page. So it's guaranteed to be static. However, I'm not sure how to "retrieve" it for use in #ask to get the other sub-pages.

I've thought of parsing the parameter to get the parent page, but it won't work since I'm using the one-step method, meaning the page name isn't filled on a preload. Is there any way to get the previous or preloaded value of the field, a-la ""? That way I could use ""


 * Hi, I have a similar problem. In my case i have a field in my form that is a dropdown type of field. I need to set the "values=" property with dynamic content, e.g:  {{{field|Clients|input type=dropdown|values={{#ask||?Name|mainlabel=-|format=list|link=none|headers=hide}}}} }}}  The inline query returns me the list of clients i have in my wiki in the following format: Client1, Client2,Client3 in accordance with the "values" property in my dropdown field.


 * The problem is when I put this query in the allowed values of the field, the query is not parsed, thus not showing the expected results.


 * Can someone tell me wich file i have to edit in Semantic Forms extension to enable the parsing of inline queries inside the form field declaration??? This correction/features is expected on new releases? Thanks everyone! Carlos Sa 14:58, 20 May 2011 (UTC)


 * First person - I can't think of any way to do that. Carlos - your problem actually sounds totally unrelated; but I would recommend creating a "concept" that matches that query, and then using "values from concept". Yaron Koren 21:20, 22 May 2011 (UTC)

Removing form edit
Hi there, if I have a category on a page containing a form edit property, is there a property i can add on the page to remove form edit?--Technobliterator 12:08, 22 May 2011 (UTC)


 * No - you might be better off using "Page has default form" instead of "Has default form". Yaron Koren 21:21, 22 May 2011 (UTC)

Upload popup never returning user to form
Hello, I have an issue with the upload form (tested in Firefox and Chromium): After uploading a file from Special:UploadWindow (or via an upload button in a form) the user is left with a blank (white) screen, and Special:UploadWindow in the address bar. Uploading seems to have completed though. The standard Special:Upload page is working. Any suggestions? rotsee 20:37, 24 May 2011 (UTC)


 * I would apply this small change, so you can see the actual error message. Yaron Koren 22:22, 24 May 2011 (UTC)


 * It seems it's not a PHP error after all, the source of the white page say like so:


 * (I have tried different browsers) rotsee 21:24, 25 May 2011 (UTC)


 * What versions of MW, SMW and SF are you using? Yaron Koren 22:03, 25 May 2011 (UTC)


 * MediWiki 1.16.1, SF 2.2-alpha, SMW 1.5.6. rotsee 13:24, 26 May 2011 (UTC)


 * Firebug gives this:

parent.document.getElementById("input_2") is null Special:UploadWindow [Break On This Error] Failed to load source for: http://säsongsmat.nu/ssm/Special:UploadWindow
 * From Special:UploadWindow (line 2) 213.89.121.199 09:03, 10 June 2011 (UTC)

Hi - that's very interesting; I haven't heard of that problem happening before. If possible, could you look at the HTML and see what the ID is of the text input that's meant to hold the uploaded file? It should be "input_2", but evidently it's not. Yaron Koren 11:18, 10 June 2011 (UTC)


 * Well, the id seems right:

	Ladda upp fil
 * Maybe this is actually a bug in fancybox? rotsee 15:17, 10 June 2011 (UTC)


 * This is the form if you want to see it yourself rotsee 15:27, 10 June 2011 (UTC)


 * I had this same problem using MW 1.17alpha and SMW 1.5.2 alpha-1. The problem is that when you select a file to upload in the pop-up form, it does not automatically fill in the destination filename like it does using the normal file upload form.  I added a warning in my forms that users must specify a destination filename when uploading a file or it will come up as a null filename and not link to anything.  The only workaround I have found is to delete those files and upload them again, specifying a destination filename, which then populates the field and links normally.  64.102.249.8 14:54, 13 June 2011 (UTC)


 * That's a totally different error. rotsee - I don't know what's causing your error, but I assume it's somehow a jQuery incomptability. Could you try upgrading to MediaWiki 1.16.5, and see if the problem persists? Yaron Koren 20:51, 14 June 2011 (UTC)


 * I finally found my problem: Fancybox will not work with  in LocalSettings, which I had even forgotten about setting a long time ago! Will add that to the docs. rotsee 09:29, 19 June 2011 (UTC)


 * Ah - good catch. Yaron Koren 15:06, 19 June 2011 (UTC)

Multiple instance template + regexp (or other validation function)
I think I have encountered a bug in SF 2.1.2

A form with a regexp input type (as defined by Extension:Semantic Forms Inputs) and a multiple-instance template, will cause an uncaught javascript exception:

at line 663 of SemanticForms.js

On quick inspection, it seems as though SemanticForms.js never populates the 2-dimensional initFunctions array stored in the jQuery("#sfform").data("SemanticForms") object. When the multiple instance template is added, it is trying to iterate on an empty array.

This has been confirmed with an example on scratchpad.referata.com.


 * It looks like this was fixed in SVN earlier today, and now it's fixed on Referata as well. Yaron Koren 22:21, 24 May 2011 (UTC)


 * That seems to have done it. Thanks for getting back so quickly!

Pre-loading data via #formlink or #forminput
I am no longer able to pre-load data through a #formlink. The wikitext is as follows:

Is there a reason this would have changed in SF 2.1.2 (or since SF 2.0.4)?

See an example on scratchpad.referata.com.


 * It looks like you just have an error in your #formlink call, in that example page - it should be 2combase[general], instead of 2_1_2Test[general] . Yaron Koren 22:28, 24 May 2011 (UTC)


 * Thanks...it would help if I RTFM :) So wikitext should be:

Parser functions in default field values
As of SF version 2.1.1 it is finally possible to use parser functions in form field default= parameters, which is great. If you're having trouble getting them to work note that it appears you need to include a space after the parser function closing braces and before the field closing braces, like this: Note the space before the final close braces, if not included it doesn't work and displays }} next to the field in the form.

--Mvoysey 08:33, 26 May 2011 (UTC)

Uploading files and default filename
In cases where you want to set the default filename= via an parser function or MAGIC WORD. It does not work as in cases of in standard field defined in a form. In comparison, the example below works without any problem. --MWJames 09:13, 26 May 2011 (UTC)

Their is an open https://bugzilla.wikimedia.org/show_bug.cgi?id=26551, for this feature request.


 * That's true - right now I think only the "default=" parameter gets parsed. Yaron Koren 22:34, 26 May 2011 (UTC)


 * I'm getting that too, It seems as though everything after the "default filename =" is being passed literally to the upload dialog. Can this be fixed to allow parser functions, magic words etc? --Scott D 13:08, 28 May 2011 (UTC)


 * This is now done, in SVN. Yaron Koren 03:09, 21 June 2011 (UTC)

Multiple 'free text' fields?
Just a basic question: would it be possible to define more than one 'free text' field in a form (for instance one after the first template and another after the second). Regards, Cavila 07:59, 27 May 2011 (UTC)


 * No. I have a potential addition to SF in mind that would accomplish somewhat the same thing, but it'll be at least a few months before that one gets added. Yaron Koren 11:46, 27 May 2011 (UTC)


 * Ok, thanks for clearing that up. Fortunately, we can still use normal fields, though things like creating tables require some special treatment (e.g. using | instead of  to circumvent parser conflicts). Cavila 13:09, 27 May 2011 (UTC)

Aggregation of semantic properties
I like the aggregation feature when making templates, but I'm stumbling on this issue.

1) I'd like to make a list from more than one semantic property. Is this possible?

2) If nothing is generated, how can I have the name of the list disappear? Can I make an #if statement regarding the aggregation pulling anything? 75.4.201.75 02:25, 30 May 2011 (UTC)


 * These questions actually seem more suited to a Semantic MediaWiki forum - I would try the SMW mailing list, or the IRC channel. (But the 2nd one might be accomplished using the "intro=" parameter.) Yaron Koren

Multiple-instance templates: template deleted if zero entries
I have a table which should have zero or multiple entries. When deleting the last entry, there is no possiblity to make a new entry. The source code of the site ist like this:

after deleting the two entries the complete template ist missing:

For normal users there is no new Entry Button. The only possiblity to make an new entry is to edit the source code.


 * I don't understand - there should always be an "Add another" button in the form, even if there are no instances currently of that template. Yaron Koren 19:58, 1 June 2011 (UTC)


 * Thanks for your answer.
 * After deleting all entries there is a "Add another" button. But after saving the page without an entry, there is only the possibility to edit the sourcecode of the page. the edit tab where the user can edit the site with the forms doesn't appears(&action=formedit).
 * The form locks like this:

Abwesend:

Projekt:


 * Ah - I didn't realize that was the only template in the form. Every form needs at least one non-multiple-instance template, to avoid the kind of problem you're having. That single-instance template would define the form for the page either directly (via "Page has default form"), or through a category. Yaron Koren 13:05, 10 June 2011 (UTC)


 * Double Ah! Thank you. Now it works. I had a other template, but the category wasn't define there. So I just had to cut the from the multiple-instance template to the other template.

Partial forms
I am confused as to the use of partial forms. I have several long pages, e.g., http://www.gausschildren.org/genwiki/index.php?title=Gauss_Index-Gen7 where each line in the table is produced by a template. I would like to have them edited by form (a popup window would be nice), as editing the source is really painful, but can't figure out how to do it, or if it is possible. Susan 03:28, 3 June 2011 (UTC)


 * Hi - it sounds like what you're asking about is being able to edit a single template call in a group of calls to the same template - in other words, a single instance of a multiple-instance template. Unfortunately, such a thing isn't currently possible with Semantic Forms, even using partial forms - those are useful only when it's different templates being called. Yaron Koren 16:14, 3 June 2011 (UTC)
 * Ah, well. I do find it much easier on my desktop where I can have multiple windows open at once.... 70.130.170.26 00:41, 4 June 2011 (UTC)


 * The issue is actually not related to being able to pop up multiple windows. Yaron Koren 01:45, 5 June 2011 (UTC)

Category Tree Style: possible to use Category Tree parameters
Hi! I intensively use the category-tree-style inputs (categories and category). Is it possible to use Category Tree parameters like "hideroot", or "depth=1"? If not, I think I could submit a patch, if you are interested in. -- FlooD 20:45, 6 June 2011 (UTC)


 * Hi - it's not possible, but it would be great. Yes - a patch would definitely be welcome. Yaron Koren 03:27, 7 June 2011 (UTC)


 * Nice: I'll post a patch as soon as possible. -- FlooD 06:33, 7 June 2011 (UTC)


 * Here's my first patch. It allows the "hideroot=on" parameter. Default is off. -- FlooD 19:01, 7 June 2011 (UTC)

Index: includes/SF_FormInputs.php =================================================================== --- includes/SF_FormInputs.php	(révision 85065) +++ includes/SF_FormInputs.php	(copie de travail) @@ -1503,10 +1503,15 @@ 		} else { $width = "500"; } +               if (array_key_exists( 'hideroot', $other_args ) ) { +			$hideroot = $other_args['hideroot']; +               } else { +			$hideroot = 'off'; +               }  		global $wgCategoryTreeMaxDepth; $wgCategoryTreeMaxDepth = 10; -		$tree = efCategoryTreeParserHook( $top_category, array( 'mode' => 'categories', 'depth' => 10 ) ); +		$tree = efCategoryTreeParserHook( $top_category, array( 'mode' => 'categories', 'depth' => 10, 'hideroot' => $hideroot ) ); // Some string that will hopefully never show up in a category, // template or field name. $dummy_str = 'REPLACE THIS STRING!';


 * I thought it would be easy to add the 'depth' parameter. I was wrong. If I limit the depth of the tree, it won't be correctly displayed when I'll open one of the branch, as the Javascript won't replace the HTML link by an input field. I don't know how to do that simply. -- FlooD 19:01, 7 June 2011 (UTC)


 * Thanks for this code! I just added it in, with slight modifications - the parameter needed is now just "hideroot", instead of "hideroot=on". Yaron Koren 14:52, 12 June 2011 (UTC)

#arraymap: using whitespace as delimiter
I'm trying and searching now for hours. I found this message: 1.2.9 - August 14, 2008 - whitespace can be used as a delimiter for #arraymap and #arraymaptemplate;

But how can I use whitespace as a delimiter for #arraymap? This: or that doesn't work.


 * I use now for this problem the ArrayExtension


 * It definitely should be documented better, but here's one way to do it:
 * Yaron Koren 01:00, 10 June 2011 (UTC)
 * Yaron Koren 01:00, 10 June 2011 (UTC)


 * Thank you!

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.

I can't find anyone else who has encountered this issue.

-- Shirl 18:16, 10 June 2011 (UTC)

autoedit
When using Semantic Forms 2.2-alpha I receive an interesting error:

I did not lock the database. Not only that, but I locked and unlocked the db using MediaWiki:LockDB/UnlockDB just to be sure.

The strange thing is...I have this working on another site, so you can probably see why this is driving me crazy. Please help. --Dgennaro 19:39, 15 June 2011 (UTC)


 * Are you sure this is related to Semantic Forms? And specifically due to something in v2.2? And why did you call the section "autoedit" - is it related to the #autoedit function? Yaron Koren 03:29, 16 June 2011 (UTC)


 * After re-reading what I wrote above it is quite vague. Yes, the issue is related to the new #autoedit feature. When I click the autoedit link to change the values that is when I receive the error message. --Dgennaro 13:42, 16 June 2011 (UTC)
 * We have tested the #autoedit function (seen below) on our MediaWiki 1.17.0rc1 (PHP 5.3.5 (apache2handler) MySQL 5.5.8), SMW 1.6 and SF 2.2-alpha test system and we have not seen any behaviour that you have described.

--MWJames 14:29, 16 June 2011 (UTC)


 * I currently have it working on another installation of MediaWiki 1.16.5, SMW 1.5.6, PHP 5.3.5 cgi-fcgi and SF 2.2-alpha...but I am not sure what the issue is here. I will post updates as I discover them. --Dgennaro 14:38, 16 June 2011 (UTC)


 * It seems that Extension:Lockdown is interfering with the #autoedit function. I will look into this and report back my findings. --Dgennaro 20:36, 20 June 2011 (UTC)


 * Okay, cool. Yaron Koren 03:03, 21 June 2011 (UTC)


 * Ok, I have found another issue with the autoedit function...but this might have been fixed already. The autoedit functions seems to be clearing all checkbox entires...Yes and No. Has anyone else had this same experience? --Dgennaro 20:34, 21 June 2011 (UTC)

Indeed, that was a bug! Thanks for pointing that out. It's fixed now, in SVN. Yaron Koren 22:15, 28 June 2011 (UTC)


 * Thanks, you are the best! --Dgennaro 13:49, 29 June 2011 (UTC)


 * Well, it was F.trott that fixed it, but sure, I'll take the credit. :) Yaron Koren 14:11, 29 June 2011 (UTC)

Wiki Links, Templates, WIthin Form Definition Pages Not Working
Hello All- On: MWv1.17.0, SMW 1.5.6, Semanticforms v 2.1.2, Semantic bundle v 20110329.20110329 I'm having the following problem. When I create form definition pages, and try to embed links to other pages in my wiki using PAGENAME The whole page link tag seems to be ignored completely. I've tried escaping the square braces, no dice. Also, while looking for a solution, I found that to embed templates in forms, you needed to escape the curly braces, commas, pipes. I decided to give this a try, and found that this also appears broken. When I follow this advice, the template name is displayed, not interpreted.

Advice would be greatly appreciated! John Major


 * This is indeed a bug in SF 2.1.2. It's fixed in the next version, 2.2, which is already in SVN, and will hopefully be released soon. Yaron Koren 06:10, 1 July 2011 (UTC)