Extension talk:Page Forms/Archive January to March 2016

From MediaWiki.org
Jump to navigation Jump to search

Contents

default value still working?

Trying to get a "signed"-field to work, i found that default=now will produce empty fields while editing with or without setting input type=date. After saving a date seems to to be set in the form. Is it a display-problem (using Chrome and Vector-view)?

{{{for template|test}}}
{{{field|test|input type=date|default=now}}}
{{{end template}}}

Using a multiple-template will also produce empty fields, if you use the add-field-button instead of getting the default-values (in my case: default=current user)

Even its not nessesary to see the date, it would be nice to set the default-value. In fact i think of hiding the form so the user just had to click the "add"-button (for a new entry) and save it. --Letofred (talk) 09:38, 30 March 2016 (UTC)

That's very strange; I can't duplicate that bug. (And I'm also using Chrome.) If the date shows up correctly in the created page, it must be a display problem of some kind, though I can't imagine what. Does it happen to you with other browsers too? And what versions of MediaWiki and Semantic Forms are you using? Yaron Koren (talk) 13:35, 31 March 2016 (UTC)
same with MS Edge; nothing to see ...
MediaWiki	1.26.2
Semantic MediaWiki	2.3.1
Semantic Forms	3.4.2-alpha

any idea, why the date is saved but not the current user?

Created an account for you - you got mail ;-) Tested it - with my account i got a date but no user; With your account (without edit-rights, just form-edit): no date, no user; OK, the field is restricted at the moment, but you will get at least one empty field if you create a page, or if you edit. Even you can add fields, also they would't be saved ... so far so good ... seems I have to remove the restriction. But even than ... date is not to be seen but saved, but no user ... --Letofred (talk) 14:27, 11 April 2016 (UTC)

We managed to resolve this "offline", thankfully - upgrading SF fixed the problem. Yaron Koren (talk) 15:32, 13 April 2016 (UTC)

Embed in field and holds template with a multiple template

Hi Friends,

Using embed in field and holds template, I am calling a simple + a multiple template.

But when I use the form, it doesn't display the templates in the right order. The multiple template always appears on top of the simple template. If I use only simple templates (I remove the "Multiple|") everything works fine.

My code is something like this :

<noinclude>
{{#forminput:form=Test|button text=Create}}
</noinclude>
<includeonly>
{{{for template|List}}}
{{{field|Fieldname1|holds template}}}
{{{field|Fieldname2|holds template}}}
{{{end template}}}
{{{for template|Template1|embed in field=List[Fieldname1]}}}
'''Fieldname1:''' {{{field|Property1|input type=text|size=25}}}
{{{end template}}}
{{{for template|Template2|multiple|embed in field=List[Fieldname2]}}}
'''Fieldname2:'''{{{field|Property2|input type=text|size=25}}}
{{{end template}}}
{{{standard input|summary}}}
{{{standard input|minor edit}}} {{{standard input|watch}}}
{{{standard input|save}}} {{{standard input|preview}}} {{{standard input|changes}}} {{{standard input|cancel}}}
</includeonly>

Is it normal ? It's a problem for me because I would like to split each template in tabs (using the Tabber extension).

Thanks a lot. Clément

What do you mean by, "The multiple template always appears on top of the simple template"? In this form, the "simple" template has no display. Yaron Koren (talk) 18:06, 16 March 2016 (UTC)
I have created this form on the Referata sandbox site. As you can see, the multiple Template2 is supposed to appears after Template1. But it doesn't when you fill in the form. When I look at the HTML, I see that the
<div class="multipleTemplateWrapper">
appears before
<b>Fieldname1:</b>
Thanks a lot for your help.
Oh, I didn't realize before that Template1 is not multiple-instance. Now I understand what you meant. This looks like a bug, though I should note that the embedded template thing was really only designed with multiple-instance templates in mind; so I would consider this a low-priority bug. If I may ask, why bother having a separate "simple" template, instead of just merging its fields into the main template? Yaron Koren (talk) 01:41, 18 March 2016 (UTC)
Good point! That solved my problem. Thanks a lot. Clément 09:35, 18 March 2016 (UTC)
Hi, I still have a problem with the Embed in field and holds template. The data that I have entered in the embedded template are not appearing after I save the form. After saving, it shows the embedded template empty (without the data that I have entered through the form). Do you know what I do wrong? Thanks again.
No idea. What does the form look like, and what version of SF are you using? Yaron Koren (talk) 16:31, 18 March 2016 (UTC)
Ok I fix it now. It was because I was calling my embedded template with 2 curly braces instead of 3. This Embed in field and holds template is very useful but a little tricky to use. I hope our discussion will help the community. Thanks a lot Yaron. I can't wait to launch our mediawiki+SF-based site and show it to you :) Best, Clément 16:49, 18 March 2016 (UTC)

Cargo and Values from Category

Using remote autocompletion and having the cargo table and field defined, nothing autocompletes from the category. This is a new form/table I am setting up so not sure if it would autocomplete from field values. I have another field that autocompletes from a category but its got less than 20 pages and doesn't need the remote autocomplete. Its the author and character fields in multiple instance templates http://absitomen.com/lexicon/Form:Plot --Cody3647 (talk) 05:40, 1 January 2016 (UTC)

I can't see the error because I need to be logged in, and registration is disabled. Could you create an account for me? Yaron Koren (talk) 16:07, 3 January 2016 (UTC)
Account created and random password sent to the email on your user page. --Cody3647 (talk) 02:31, 8 January 2016 (UTC)
Okay, thanks. What is an example of a value that doesn't show up during the autocompletion? Yaron Koren (talk) 18:55, 8 January 2016 (UTC)
The characters field in the character group multiple instance template section. It only brings up names that are already in the cargo table/field instead of getting values from the category. (I had removed the cargo table/field parameters to get it to work but added them back to that section so you can see it not auto complete based on category values.) --Cody3647 (talk) 01:33, 9 January 2016 (UTC)
I think you misunderstood my question - I want an example of a value (i.e., character name) that should show up in autocompletion but doesn't. Yaron Koren (talk) 05:12, 9 January 2016 (UTC)
"Kelvin Watkins" Should get pulled but doesn't. --Cody3647 (talk) 06:11, 9 January 2016 (UTC)
Ah, yes. I think I just fixed this in the SF code. Yaron Koren (talk) 16:28, 10 January 2016 (UTC)

Getting error popup missing dependencies 3.4.1

I'm getting a missing dependencies error popup when trying to edit with form MediaWiki 1.25.5 Semantic MediaWiki 2.3

What's the exact error message? And what version of SF are you using? Yaron Koren (talk) 16:07, 3 January 2016 (UTC)
I too get this, a popup saying
   ext.semanticforms.main: Error: Module ext.semanticforms.main has failed dependencies
I think it happens only with multi instance templates in the form, but I'm not entirely sure. I'm on `3.4.1`. 182.161.2.94 10:06, 24 January 2016 (UTC)
Is this on a public wiki? If not, could you pastebin the form definition? Yaron Koren (talk) 23:58, 24 January 2016 (UTC)
Hello Yaron. I had the same message some time ago and found out that this was caused by a syntax fault in combination with a datepicker field. See here for an example. When you edit the page with the form the fault appears and the datepicker won't load. In the form I used show on select=A=saa;A=>saaa...... but it should be Showonselect text|show on select=A=>saa;A=>saaa......... It does not happen when there is no datepicker field. I did not investigate any further but maybe this sheds some light on the issue. --Felipe (talk) 13:29, 25 January 2016 (UTC)

Unselected default value keeps returning

Example,

| {{{field|LIGHT|default=LED}}}

I un-check LED, and don't check any other values for that field. I save, everything saves correctly, but when I edit the form, "LED" is there again. I have to uncheck "LED" every edit. Is there any way for SF to remember that this is unselected? And if not, can anyone think of another way to do this? --Frybread (talk) 07:16, 6 January 2016 (UTC)

That's strange. What version of SF are you using, and what's the input type? (I'm assuming "checkboxes".) Yaron Koren (talk) 07:20, 6 January 2016 (UTC)
Hey Yaron! Thanks for taking time to answer. If you're interested, I re-created the issue on the SMW sandbox. http://sandbox.semantic-mediawiki.org/wiki/SMWrules (click edit, unselect LED, and save - then try editing again. LED will appear as checked.) Here are links to the form and template and property.--Frybread (talk) 03:01, 8 January 2016 (UTC)
Yes indeed, you found a bug. Sorry about that. I think I just fixed it in the SF code. Yaron Koren (talk) 05:14, 9 January 2016 (UTC)

Using a form to edit a specific template

Is it possible to use separate forms to edit the various templates in an article? When I tried doing that, it rearranged the article which is the opposite of what I intended on doing. --CyberXRef? 17:11, 7 January 2016 (UTC)

Are you using "partial forms"? If not, each form needs to include each of the page's templates - unhandled templates should just look like "{{{for template|TemplateName}}}{{{end template}}}". Yaron Koren (talk) 17:58, 7 January 2016 (UTC)

Form Errors

After pulling the latest version from git, getting the following error on a form with restricted fields. Fatal error: Call to a member function getEffectiveGroups() on null in /home/absitome/public_html/wiki/extensions/SemanticForms/includes/SF_FormField.php on line 317.

Also dropdown fields are not getting values from the allowed values defined by the cargo table declaration. And under the add button for multiple instance templates getting "@insertHTML_Character infobox___wands@"--Cody3647 (talk) 05:17, 9 January 2016 (UTC)

The @insertHTML_Form_Name@ is also getting placed into the wikitext --Cody3647 (talk) 06:30, 9 January 2016 (UTC)
The first issue was due to some recent refactoring I've been doing - sorry about that. I think I just fixed it in the SF code. I wasn't able to replicate the other three issues, though - where are you seeing those? Yaron Koren (talk) 05:45, 10 January 2016 (UTC)
Im using an older version I grabbed from before the refactoring, so its not showing now. But it was showing under the 'Add...' button for every multiple instance template. Random fields (both dropdowns and textfields) were losing the values that they had before clicking show changes and the multiple instance templates that should have been going into a field were going after the main template. --Cody3647 (talk) 23:49, 10 January 2016 (UTC)
Alright - hopefully it won't happen again. Please put in a link to the form if it does. Yaron Koren (talk) 02:30, 11 January 2016 (UTC)

Uploading directly from a URL

I noticed that Semantic Forms doesn't allow uploading directly from a URL (sideloading). Is this something on my end, or a bug?

Using Special:Upload: http://i.imgur.com/NmPrdsd.jpg

Using Semantic Forms: http://i.imgur.com/YWUBaMZ.jpg

This was a bug - I don't know how long it's been around, but I think it's fixed now. Yaron Koren (talk) 04:04, 13 January 2016 (UTC)
Thank you! I'll make sure to update before posting again.--Frybread (talk) 08:56, 13 January 2016 (UTC)
This has been around for more than a year. I never got around reporting it. However it is still an issue with SF 3.4.1 on WikiApiary where you cannot add an URL to the Source URL field. The fix must currently still be in master. --[[kgh]] (talk) 12:51, 17 January 2016 (UTC)

Best practice for adding section headers in page created by multi-instance template form?

An example is a Recipe Form containing two Multi Instance templates. Ingredient and Step. I'm trying to place section headers between the Ingredient and Cooking steps. A generated page might look like this:

{Recipe|Wafles} {Ingrediant|Waffle} {Ingredient|Hyrup} {Step|Cook Waffle} {Step|Cover In Hyrup} {Step|Enjoy}

I've considered surpressing output in the Ingredient and Step templates and adding all the semantic queries to the Recipe template. This seems like a redundant query however.

Doing embedded templates might be the easiest approach - look for "embed in field" and "holds template" here. Yaron Koren (talk) 20:37, 13 January 2016 (UTC)

Naming of field IDs

Any chance it might be possible to somehow name the css id's of the semantic forms fields? I see that you can do this for the class, but the ID would be helpful for javascript and other tedious css tweaks. --Joshkking (talk) 01:37, 14 January 2016 (UTC)

Can't you just use the class, by calling getElementsByClassName() or something? Yaron Koren (talk) 14:35, 14 January 2016 (UTC)
It's certainly doable, though it feels wasteful and against dogma to keep making classes for single elements. I suppose I cant justify myself much more than that though.--Joshkking (talk) 22:25, 14 January 2016 (UTC)
Actually I do recall another instance where I was wishing we could define our ID in semantic forms-- that of ID's having a higher priority level. I found a workaround for myself on that issue by marking something as important!, but obviously that's not preferred. Anyways, I don't think it's a necessary thing, but I do think it would be a noteworthy feature. Moreover, selecting by ClassName doesn't seem as well supported by all browsers. --Joshkking (talk) 23:27, 14 January 2016 (UTC)

System message duplicated on action "formedit"

Heiya, in case a wiki requires a user to be logged in for editing the system message "permissionserrorstext-withaction" is shown twice on action "formedit" while only once for action "edit" which is the expected behaviour. See the difference on sandbox.smw.o where I recreated the problem. Help on this and/or a fix is greatly appreciated. Cheers --[[kgh]] (talk) 13:06, 17 January 2016 (UTC)

Seems to be a bigger issue. I filed this as task T124654. Cheers --[[kgh]] (talk) 13:01, 25 January 2016 (UTC)

Can I used SForms to Append a new subobject to page name

I'm trying to log eggs produced by my chickens and display with a timeseries plot. On the first attempt I created an egg harvest per page using making a pagename eggs/<unique>. After some debugging, i've determined the data needs to be subobjects for timeseries result-format to work. Ideally i'd like the form to seem like the "Add Topic" button on this talk page, where data entry for 1 harvest is entered and appended to a pagename=egg/<year>/<month> page. I'm having some difficulty formatting the date-component into <year> and <month> for pagename. Can the "Add Topic" user interaction be achieved with SMF and the "section" option? Thanks again!

Do you know about multiple-instance templates? (It's just "SF", by the way.) Yaron Koren (talk) 17:24, 21 January 2016 (UTC)

Change page name within form?

Hi Yaron, I create page names with help of #formlink, which works fine. Now users should also be able to rename the page name. Is that possible within the form? If I read this I'm afraid not and I will have to use something like this and tell people they have to move the page... --Stefahn (talk) 16:42, 28 January 2016 (UTC)

No, you can't rename/move a page from a form, unfortunately. Yaron Koren (talk) 18:11, 28 January 2016 (UTC)
Thanks for the confirmation. Stefahn (talk) 21:37, 28 January 2016 (UTC)

The specified target page "title" is invalid.

So I have a form that creates pages based on two fields. It was working, but one of the members just told me that it is not working. Its giving a target page is invalid whenever it tried to preview or save. Also some of my links to the form pass on a parameter and it is no longer getting passed either. This is happening in both the latest version from git and from 3.4.2 from git. Ive currently gone back to another version that does work, though the version listed under version is not correct. I believe its commit f649edc but with a couple of fixes back ported. --Cody3647 (talk) 06:05, 2 February 2016 (UTC)

I can't replicate this problem. Have you observed it directly? And what is the page name formula you're using? Yaron Koren (talk) 14:43, 4 February 2016 (UTC)
Yes, I tested it and got the same result. The page name formular is page name=<Event[title]> ({{#time: j M Y | <Event[date]> }})<unique number> --Cody3647 (talk) 16:42, 4 February 2016 (UTC)
Okay, I see the issue - it's indirectly due to that #time call. Commenting out this line will fix the problem - I worry, though, that removing it will cause other problems. Out of curiosity: are you sure that this works with that version from a month or two ago? That line was added in 2012. Yaron Koren (talk) 18:05, 4 February 2016 (UTC)
Its working. I just created a bunch of pages with the form the same day after going back to that version and it creates the correct title. The only errors showing up in the error log are "PHP Parse error: syntax error, unexpected '<<' (T_SL) in /extensions/SemanticForms/SemanticForms.php on line 68" and those Im pretty sure are from before I rolled back to the previous version. But even if they arent, there are only 3 of them and I created a couple dozen pages.

Mandatory Sub-Checkbox

Hi Yaron. I created a form with a few checkboxes. They are not mandatory. If one checkbox is checked, a new list of checkboxes appears. Now I want to force the user to check at least one of those new checkboxes. Is there any common way? Thank you. --DirkCogno (talk) 07:12, 4 February 2016 (UTC)

What about making those other checkboxes mandatory? Yaron Koren (talk) 14:34, 4 February 2016 (UTC)

SF 3.4.2 Problem with parameter transfer

Hi Yaron. Since upgrading to SF 3.4.2 my forms do not work any more. They refuse to transfer given parameters with query strings. I did not have this problem with SF 3.2. Can you give me any hints? Thank you. --DirkCogno (talk) 11:00, 4 February 2016 (UTC)

Hi - "do not work any more" sounds a bit extreme... the only thing that doesn't work is the query strings? If so, that was a bug that was fixed a few days ago - if you get the very latest code, either by download or via Git, the problem should go away. Yaron Koren (talk) 14:34, 4 February 2016 (UTC)
Thank you for answering so quickly and sorry for my extreme expression. Your are right ... only the query strings do not work correct. I followed your link to the SF 3.4.3 alpha. Everything is fine now with the query strings. Thank you. But now another problem occurs: Pipes in free text input are not allowed. Very similar to this topic from november last year. --DirkCogno (talk) 15:06, 4 February 2016 (UTC)
I think he means this topic Pipes in free text input not allowed? --User:SnowlDD
Yes, probably. I can't reproduce this problem, though. Is it definitely a free text field, and not a template field? Is it "standard input|free text" or "field|free text"? Yaron Koren (talk) 18:15, 4 February 2016 (UTC)
You are right, Yaron. The field definition is
{{{field|Inhalt|input type=textarea|rows=40|cols=100}}}
This error occured with SF 3.2 with this field type, too. --SnowlDD (talk)
What's the error? Pipes are not allowed in template fields on purpose. Yaron Koren (talk) 20:51, 4 February 2016 (UTC)
The content of the field is i.e.
{{#ask: [[Typ::Maßnahme]] [[Maßnahme::M 3.1 Geregelte Einarbeitung/Einweisung neuer Mitarbeiter]]
|mainlabel=Code
|?Phase
|?Maßnahme
|?Anforderungen
|?Bemerkungen
|?Umsetzungsstatus
|?Verantwortlichkeit
|?Terminierung
|link=none
...
}}

This works until version 3.2 and it works with 3.4.2 (where we have the error described above). In 3.4.3 alpha we get the message

"|" is not allowed, except within {{...}} or [[...]]

, although the pipes are in {{..}}, again.

Will it help if we give you access to this wiki?--SnowlDD (talk) 06:46, 5 February 2016 (UTC)

I can't reproduce that problem. Sure, I suppose access might help. Yaron Koren (talk) 14:23, 5 February 2016 (UTC)

Problem with formlink

Hello,

please, could explain why the edit link are not well generated when I use the following code ?

  • Bad edit link HTML code generated
<a href="/wiki/Special:FormEdit/Archi/&lt;!--LINK_0:0--&gt;" class="new" title="" target="_self"><img alt="Edit.png" src="/w/images/d/d2/Edit.png" width="32" height="32" /></a>
  • Expected edit link HTML code
<a href="/wiki/Special:FormEdit/Archi/80CH190" title="" target="_self"><img alt="Edit.png" src="/w/images/d/d2/Edit.png" width="32" height="32" /></a>
  • ASK request
{{#ask:
| mainlabel=-
| ?=Title
| ?Nums
| ?Tabagns
| ?Proms
| ?SurName
| ?LastName
| ?FirstName
| ?Bande
| ?Photo
| ?Parrain
| format=template
| template=ArchiList
| introtemplate=ArchiListHeader
| outrotemplate=ArchiListFooter
| sort=Nums
| order=asc
| limit=500}}
  • template ArchiList
<includeonly>
|{{#formlink:form=Archi|link text=[[File:edit.png|link=]]|target={{{1|}}} }}
|{{{2|}}}
|{{{3|}}}
|{{{4|}}}
|{{{5|}}}
|{{{6|}}}
|{{{7|}}}
|{{{8|}}}
|{{{9|}}}
|{{{10|}}}
|-
</includeonly>

Is there a problem with the template and/or the ask request ?

Regards

No idea. It would be a hack, but maybe you could generate the needed HTML with the Widgets extension instead? Yaron Koren (talk) 18:04, 5 February 2016 (UTC)
Ok, thx for your help
it seems that I can solve the problem by adding | link = none in the query ;-)
but I will keep to your answer to solve another problem

Using two variables for page creation

Heiya, just to confirm: It does not seem possible to combine the <unique number> with the <template-name[field-name]> parameter like e.g. {{{info|create title=Add new page|edit title=Edit page|page name=20160212_<unique number;start=01>_<20160212[Month]>}}} with the "#formlink" parser function (one step process)? Cheers --[[kgh]] (talk) 17:14, 12 February 2016 (UTC) Edit PS: the form and the template with this button.

I have a form running with {{{info|page name=<report[page]>/report <unique number;start=00000001>|add title=Bericht erzeugen|edit title=Bericht bearbeiten}}}. One-step process with #formlink ({{#formlink:form=Report}}) works like a charm (on MW 1.23.13, SF 3.4).
---- Tobias (talk) 17:45, 12 February 2016 (UTC)
Either it is a bug or I have senior moments right now. Currently I do not even get {{{info|create title=Add new page|edit title=Edit page|page name=20160212_<20160212[Month]>}}} to work. I am on SF master and MW 1.25.5 I am pretty confused. Tried to juxtapose "info" and "for template", etc. however ... nothing. Hmm ... --[[kgh]] (talk) 18:05, 12 February 2016 (UTC)
Give it a try with SF3.4. My 1.25.5 installation has multiple issues with SF master at the moment.---- Tobias (talk) 18:11, 12 February 2016 (UTC)
I am completely lost right now. Reverting back to 3.4.0 does not help either. I just get "the provided page name 20160212_<20160212[Month]> is invalid." Probably the "20160212" template is messed. I just added {{{field|Month}}}, perhaps this is the issue, though I have a working template like this on a MW 1.23.13. Dunno ... --[[kgh]] (talk) 18:26, 12 February 2016 (UTC) Edit: PS. I am back on SF master since this is the version that should work at some point.
Could you pastebin (or link to) the full form definition? Yaron Koren (talk) 01:50, 13 February 2016 (UTC)
Probably a senior moment: the form and the template with this button. I guess the solution will be trivial. --[[kgh]] (talk) 13:38, 13 February 2016 (UTC)
This was a strange one! The issue seems to be that you have an invisible character right before the final "}}}" in the form's "for template" tag, that is messing up the parsing. If you delete that line and re-type it, the problem should hopefully go away. Yaron Koren (talk) 01:43, 16 February 2016 (UTC)
Wow, this was indeed a riddle. Did this change and the issue went away. Still do not know how this go there but it is good to know. Thanks a ton! Cheers --[[kgh]] (talk) 08:48, 16 February 2016 (UTC)

Semantic Specialpages missing with MW 1.26.2 and SMW 2.3.1

After a fresh install of MW 1.26.2 and installing SMW 2.3.1 through composer, I see that special pages of SMW are missing from Special:SpecialPages. Also in all property declarations, builtin properties like "Has type" is linked as new (red).

The same install of SMW (2.3.1) works with MW 1.25.5 flawlessly.

Is there a step missing in install documentation?

You are talking about the special pages provided by Semantic Forms or Semantic MediaWiki? Using this talk page suggests the first, I am not sure though. Cheers --[[kgh]] (talk) 13:40, 13 February 2016 (UTC)

Properties aren't saved/populated

Hi i'm using MW 1.26.2 and Semantic Forms 3.4.3. I've created properties, a template and a form. Everything is working, but the properties aren't saved. My definition in the form:

{{{field|Software name|property=Software name|mandatory|input type=text with autocomplete|size=40|maxlength=40|placeholder=z. B. "Abacus"}}}

The property is called "Software Name". With $smwgShowFactbox = SMW_FACTBOX_SHOWN; in LocalSettings.php I can see, that the saved form-page has no saved properties. Can anybody help me? What can be the problem? Regards, Stefan

If you just do an "edit" (not "edit with form") on the page created by the form, do you see the right value there? If not, it's a Semantic Forms issue - if it's there, it's a Semantic MediaWiki issue. (By the way, you probably don't need that "values from property=" parameter, but that's a minor point.) Yaron Koren (talk) 16:15, 16 February 2016 (UTC)
Thank you, I've checked that width "edit with form", after saving. The result is this:
{{Software
|Software name=Test3
|Vendor software=dgsg
}}

Sorry, but i didn't understand: is it now a Semantic Forms issue or a Semantic MediaWiki issue?

In the form, it's "Software Name", and in the page it's "Software name" - two different capitalizations. Could that be the problem? I don't see how that page could have been created with that form... Yaron Koren (talk) 18:47, 16 February 2016 (UTC)
No, sorry. the field called firstly "Software Name", but I've deleted that, and created after that a new property "Software name" (see above the corrected code). I've tried with "Vendor software", too, but the property is empty! Any suggestions?
Hi Stefan, you've given no information about how you've set up your template to use that property. Is something wrong there? Cavila 11:58, 17 February 2016 (UTC)
Hi Cavila. it's very strange. I made a lot of tries last day. If I create a new category, 3 new properties, a template, a new form and a new article with the form, is everything OK. It's working. But if I create more and more properties, adding this to the existing template and form, than the properties aren't saved anymore. Every property is empty. After that, if I deleting the newly added properties from the template and from the form (=it means, I'm going back to the first state of the form and template), the semantic data is empty. That means, that maybee the data of the form or template is corrupted in the database! I can't adding new article, too. If I create everything (category, properties, template and form) new with new names and the "same" things, than it's working! It's really crazy. Something has to go wrong by saving, I think. Here is my needed form and template:
The form:
[Removed this - it turned out to be irrelevant]
And my template:
<noinclude>

==Beschreibung== Standardvorlage für Software und Systeme (ITQM). ==Verwendung== Bitte den folgenden Zeilen in den Artikel einfügen und hinter dem "="-Zeichen die Werte setzen: <pre> <nowiki>{{Softwarevorlage |Software name= |Software vendor= |Support contact=<!-- (Mail, Phone) --> |Functions= | |Business-Process=<!-- (CRM, PLM, SCM, FM, QM) --> |Process-Owner= |Key-User=<!-- ggf. Key-User(Business) --> |Service-Owner=(Link in Kategorie System Owner im Wiki (unten) |Service-Owner StV=<!-- ggf. Service-Owner StV. (OIS) --> |Change-Coordinator=<!-- bei Konzernsystemen Change-Coordinator (OIS) --> |Operations-site= | |Datenschutzvertraulichkeit=<!-- (öffentlich,intern,vertraulich*,streng vertraulich*) --> |Datenschutzintegrität=<!-- (niedrig,mittel,hoch*) --> |Datenschutzverfügbarkeit=<!-- (niedrig,standard,hoch*,sehr hoch*) --> | |<!--* Ein Sicherheits- und/oder Betriebskonzept ist zu erstellen, welches die Anforderungen sicherstellt; ggf. auch Datensicherung.--> | |Regulatorische Risikoeinstufung=<!-- (nicht erfolgt,nicht relevant,relevant); siehe [[Risikobeurteilung_Software_oder_Inventar_(FDA)]] --> |Begründung der Einstufung= |Audit-Trail=<!-- notwendig / vorhanden?= Ja / Nein --> |Software version= |Validierung=<!--Datum / Ablage / SW Version --> |Lieferantenbewertung=<!--(macht IT oder Einkauf; -> Link auf PH SOP; Self Assessment und Besuch sofern erforderlich; Ablage hier --> |Userverwaltung= |Datensicherung= | |Lizenz=<!-- Anzahl / Lizennachweis (Scan) --> |Ablageort=<!-- (Install-Datei, Konfig, Anleitung) --> |Verweis auf Paket= |Besonderheiten= }}


</nowiki>

Hi Stefan, there's nothing in your template to suggest that you're using properties! Please see https://www.semantic-mediawiki.org for information on how to use SMW. Concerning the use of templates in particular, you could have a look at this page. Cavila 11:29, 19 February 2016 (UTC)

Sorry, it was my fault! Now it's working. :)

delete instance of multi instance template

I updated last weekend to get the datepicker fix. One of my users noticed something weird going on with the multi instance template. I had a datepicker that was supposed to prepopulate the date and it wasn't getting added. I'm not entirely sure what was going on, but I saw there were some more recent updates, so I pulled that and that issue is gone. However, now I can't seem to delete an instance in the multi instance template. Is there still some work being done here? Thanks. --Kc5vcx (talk) 22:51, 18 February 2016 (UTC)

Update: It just won't seem to let me delete the last/only instance of a multi instance template. I mean I can click the gui X and it goes away, but when I save the form page it doesn't actually change anything, even version history doesn't register a diff. I have min instances set to 0 in the form. I have to go to edit source to get rid of it, but then and I don't think I noticed this before, when I don't have any instances I see {{{Template}}} on the page like as a place holder. --Kc5vcx (talk) 23:03, 18 February 2016 (UTC)

Are you using the very latest version of the SF code? I just made some fixes for multiple-instance template handling earlier today. Yaron Koren (talk) 01:48, 19 February 2016 (UTC)
I think/thought so. I did git pull on the master branch and I see the updates in the log, but Special:Version still says Semantic Forms 3.4.3-alpha (72c7267) --Kc5vcx (talk) 03:07, 19 February 2016 (UTC)
I found the discussion over at https://phabricator.wikimedia.org/T126770. I pulled the latest again and the removal of last multi instance appears to work now. Thanks. --Kc5vcx (talk) 18:34, 20 February 2016 (UTC)
That's great to hear! Yaron Koren (talk) 22:27, 21 February 2016 (UTC)

Multiple section fields content are merged to the top one after edit

I have a classical form with classical fields and 4 section fields before the free text area.

The first edition of a page with this form is ok section apears normally.

But when I try to reedit with the form the content of 3 last section fields PLUS the free text content appears in the first section field.

This 3 last section fields PLUS the free text are now empty.

Nicolas NALLET (talk) 14:28, 23 February 2016 (UTC)

What version of SF are you using? Yaron Koren (talk) 14:31, 23 February 2016 (UTC)
3.4.1
FYI I have found a workaround to avoid the merge is to put a call to any template ( {{for template...}} {{end template}} ) in the form definition between section tags and last section tag and free texte tag. In other word this bug apears only when section tag/free texte are following Nicolas NALLET (talk) 15:03, 23 February 2016 (UTC)
I would try upgrading to the latest version from Git - there have been a lot of changes to the parsing since 3.4.1. Yaron Koren (talk) 15:29, 23 February 2016 (UTC)
Ok thanks, I will upgrade and keep you in touch next week. Nicolas NALLET (talk) 15:53, 23 February 2016 (UTC)
Hello, Unfortunately, I got the same problem with last version (3.5) Nicolas NALLET (talk) 14:02, 1 March 2016 (UTC)
I can't reproduce the problem - could you pastebin (or link to) the form definition you're using? Yaron Koren (talk) 21:43, 1 March 2016 (UTC)
I's on a private wiki that I can't access now but I have reproduced the problem on this page. If you edit with the form you will see that free text is in the last section field and not in the free text area. You can try editing anything on the free text, save and redit with form and you will see that what you have edited is in the last section field. Nicolas NALLET (talk) 15:19, 7 March 2016 (UTC)
Alright. I see one problem here, which is that the last two elements in the form are a section input, and a free text input. A form should not end with those two, because then SF has no way to know what belongs in the section, and what belongs in the free text. One option is to just get rid of the free text. If you do fix that in one way or another, does the main problem go away? Yaron Koren (talk) 16:43, 7 March 2016 (UTC)
One solution is to put a call to an (empty) template in the form definition between the section and free text inputs
{{{section|Exemples|level=2}}}

{{{for template|AnEmptyTemplate}}} {{{end template}}}
'''Texte libre:'''

{{{standard input|free text}}}

But the user can see a lot of templates in the wikicode and could be willing to delete it and thus sections are merged again... Nicolas NALLET (talk) 09:07, 8 March 2016 (UTC)

Multiple-instance template within multiple-instance template

Hi,

I'm building a set of forms for managing internal software documentation at our company, and I've found that it would really help if it was possible to nest multiple-instance templates within other multiple-instance templates. To simplify a bit, I need to have a form for a "Service", which has multiple data "Providers" - these are separate categories/pages with each entity having its own name. However, for each service I need to document a variable number of data "Adaptors", which are part of the service and don't even have their own names - so I'm reluctant to represent them as separate pages. Finally, for each adaptor I need to represent a variable set of properties, which brings me to this multiple-within-multiple issue.

I guess I have two questions:

1. Are there any plans to enable this kind of nesting?

2. How would you suggest to approach this problem with current restrictions?

Thank you!

No, there are no plans to support it. It would be good to get more detail on the last part of your data structure - "for each adaptor I need to represent a variable set of properties". But assuming this isn't something out of the ordinary, I do think you would have to have a separate page for each "Adaptor". You can use the "one-step process" and a page name formula if you don't want there to be a true name associated with each one. Yaron Koren (talk) 17:07, 9 March 2016 (UTC)

Missing files from download link

In the download section, the link that produces a .zip file for installing the extension is missing most of the /includes folder.

What's an example of a file or directory that's missing? Yaron Koren (talk) 21:07, 13 March 2016 (UTC)

Sorting in pulldown field

I have a String property with several allowed values. In the form, I use this property to generate a pulldown field. The entries in the pulldown are not being sorted alphabetically. Of course I could sort them by hand in the property definition, but is this the desired behaviour, shouldn't all pulldowns be sorted automatically according to documentation?

I understood everything except the last part - what do you mean by "sorted automatically according to documentation"? Yaron Koren (talk) 12:43, 14 March 2016 (UTC)

Pipes are not allowed

Hi Yaron,

since upgrading to Semantic Forms 3.4 or greater i have the following problem:

"|" is not allowed, except within {{...}} or [[...]]

, although the pipes are in {{..}}. What is to be done?

I found two entries with the same problem in this discussion, so i hope you can help me. Thanx.

This is the form:

{{{for template|SNOWL:FrageAntwort}}}{{{field|Spezifikation|input type=text|mandatory|hidden}}}{{{field|FrageReferenz|input type=text|mandatory|hidden}}}{{{field|Kanzlei|input type=text|mandatory|hidden}}}{{{field|Mandant|input type=text|mandatory|hidden}}}{{{field|Prüfungsjahr|input type=text|mandatory|hidden}}}
{| class="formtable"
|-
| colspan="3" | {{{field|Frage|input type=textarea|class=Frage|restricted=noone}}}
|-
| colspan="3" | '''Antwort'''*<br>{{{field|Antwort|input type=textarea|editor=wikieditor|mandatory}}}
|-
| colspan="3" | '''Anhang'''<br>{{{field|Anhang|input type=textarea}}}
|}
{{{end template}}}

and this is the content, i would like to save

{{#ask: [[Typ::Antwort]]
|?Antwort
|?Anhang
|link=none
|headers=hide}}

It doesn't matter, if I try to save it in field Antwort or Anhang, result is the same.

addition:

Using a template like

{{Antwort|Richtig}}

no error occurs. Seems to be a problem in combination with parser-function ask... --217.234.148.28 14:52, 14 March 2016 (UTC)

What version of SF are you using? Yaron Koren (talk) 14:59, 14 March 2016 (UTC)
actually 3.6alpha, but the problem exists since 3.4.2

another addition: Using

{{#ask: [[Typ::Antwort]]
|?Antwort
|?Anhang
|link=none
|headers=hide}}

occurs an error like as mentioned above.

Curiously

{{#ask: 
|?Antwort
|?Anhang
|link=none
|headers=hide
|[[Typ::Antwort]]}}

occurs no error, ask gives correct results. The pipe before [[ ]] doesn't matter for the error, but for the result of ask.

Hope this additions will help to find the problem. --217.234.148.28 15:08, 14 March 2016 (UTC)

Aha! This one I could reproduce. I just checked in what I think is a fix - if you try out the latest code, please let me know if it works for you. Yaron Koren (talk) 19:20, 15 March 2016 (UTC)
That's fine. When will the fixed code be available? --109.43.2.119 12:49, 17 March 2016 (UTC)
It's available already - you just need to get the very latest code, whether you're using Git or downloading. Yaron Koren (talk) 13:00, 17 March 2016 (UTC)

input type=categories

MediaWiki 1.26.2
Semantic Forms 3.6-alpha
Semantic MediaWiki 2.3.1
Semantic Forms Inputs 0.10.0

I updated to the latest release of Semantic Forms and Semantic Forms Inputs.

I’m using |{{{field|cat|input type=categories|top category=category|hideroot}}}

It used to give me a list of categories with checkboxes for each category, now it creates a bulleted list.

Is there another way of getting the checkboxes back?

Wasn't this already addressed on the semediawiki-user mailing list? Yaron Koren (talk) 17:27, 14 March 2016 (UTC)

Invalid non-numeric limit passed to limitResult()

I have this issue when I try to create a page or edit one with SF [1]


[1] http://innovacion.educa.aragon.es/wiki/Especial:FormEdit/CatalogoProgramas/test

That's a strange one - I don't think I've seen that error message before. You're using a somewhat old version of SF; maybe try upgrading? Yaron Koren (talk) 13:38, 15 March 2016 (UTC)
No, just 3.6-alpha (REL1_25 branch) and I don't know how to debug it because I can't see any error in the logs. --Lmorillas (talk) 22:01, 15 March 2016 (UTC)
The Special:Version page says it's SF 3.2. Or are you also seeing this problem on another wiki? Yaron Koren (talk) 23:34, 15 March 2016 (UTC)
No, it's the correct page. It changee the version with the git branch. Now it says SF 3.6 --Lmorillas (talk) 08:01, 16 March 2016 (UTC)
Thanks for upgrading. The limit for queries within the form is set by a combination of the $sfgMaxAutocompleteValues and $sfgMaxLocalAutocompleteValues variables - are you modifying either one within LocalSettings.php? Yaron Koren (talk) 13:26, 16 March 2016 (UTC)
No. None of them are modified within LocalSettings. And other Forms and working fine.
What about the similar variables in Cargo, $wgCargoDefaultQueryLimit and $wgCargoMaxQueryLimit - are you setting either of those? Yaron Koren (talk) 16:43, 16 March 2016 (UTC)
No, Cargo has no special configuration. It's only required with the require_once() expression. --Lmorillas (talk) 16:47, 16 March 2016 (UTC)
I have no idea, then. The only thing I can suggest is to start removing stuff from the form until the error goes away, to isolate which field, or fields, are causing the problem. Yaron Koren (talk) 17:12, 16 March 2016 (UTC)
Solved with a Cargo upgrade. Thanks, Yaron. --Lmorillas (talk) 21:59, 16 March 2016 (UTC)
That's great to hear! Yaron Koren (talk) 23:55, 16 March 2016 (UTC)

Paramenter popup doesn't work

Semantic Forms 3.4.2 / 3.5 / 3.6alpha Semantic Mediawiki 2.3.1

Hi Yaron,

the call of popup in formlink doesn't effect anything anymore. Works until SF 3.2.

The form opens in the current browser window. What is to be done? --217.234.153.175 15:00, 15 March 2016 (UTC)

Do you know how to look in the JavaScript console? If so, is there an error message there? Yaron Koren (talk) 15:07, 15 March 2016 (UTC)
load.php alerts TypeError: ext.popupform is undefined, hint to line "127" in load.php (maybe line-no depends on width of browser window); using Mozilla Firefox 45.0 --109.43.2.119 10:19, 17 March 2016 (UTC)
Yes, okay - I tried using a popup form myself, and got this same error. It turns out that there was a bug that was added about a month ago. I think I just fixed it; if you get the latest code, hopefully everything will work. Yaron Koren (talk) 01:29, 18 March 2016 (UTC)
I had the same error message (TypeError: ext.popupform is undefined), installed the newest version of SF (Version 3.6-alpha) (with MediaWiki 1.21.2 and Semantic MediaWiki Version 1.8.0.4). Now I can link to a popup, the popup is displayed, but when I click on the form's save button, I get the following message in the console: TypeError: mw.hook is not a function (load.php:103:803). LambdaB (talk) 12:42, 14 April 2016 (UTC)
I don't get that error message. Do you have any other SF-based extensions in use on that form, like SFI or SFS? And does the page save? Yaron Koren (talk) 01:22, 18 April 2016 (UTC)

Multiple "autocomplete on category"?

Is it possible to supply multiple "autocomplete on category" parameters?

I know it's probably not in-sync with the current SMW model where a class maps to a category, but having this could have its benefits:

For example I'd like to categorise entries of organisations not on "category Organisation" but on their respective subtypes, i.e NGO, governmental, company, collective, etc. And I would like the 2-step form to be able to autocomplete on the sum of instances from all of these categories.

Also I do not want to categorise instead on a category (organisation) and its subcategories at the same time just to have autocompletion work.

As an alternative to auto completing from multiple categories it could possibly be a flag to pass to autocomplete to have it include pages from a category and its subcategories?

I don't know how feasible is this, and I'm not sure whether it breaks anything else.

Nor if there's another, better, way to do this?

--Ahmad Gharbeia أحمد غربية (talk) 19:58, 16 March 2016 (UTC)

I think "values from category" already gets the pages from the subcategories as well - have you tried it? Yaron Koren (talk) 00:14, 17 March 2016 (UTC)
It seems to do so indeed! Thanks, Yaron Koren.
However I keep getting inconsistent results with autocompletion when the target names are in Arabic script. A page which name is in Latin script in the [sub]category appears in autocompletion with no problem.
--Ahmad Gharbeia أحمد غربية (talk) 16:59, 28 March 2016 (UTC)
So, more clearly, my question is: Is autocompletion of page names working for non-Latin scripts as well? Hebrew for example? Arabic in specific?
--Ahmad Gharbeia أحمد غربية (talk) 12:08, 10 April 2016 (UTC)
Sorry for not responding before. Yes, there are problems with autocompletion with some (or all) non-Latin alphabets. Trying a different input type might help - like "combobox" instead of "text with autocomplete", for instance, or the other way around. Yaron Koren (talk) 13:22, 10 April 2016 (UTC)

Mediawiki sidebar interferes with the form when in a popup

{{#forminput:form=Repository Info|autocomplete on namespace=MAIN|popup|placeholder=Repository name…|button text=Create or update repository page}}

When loading a form in a popup/modal, the site's sidebar is still visible and the form loads in the popup as if it were a regular page on the site. Is it possible to hide the site sidebar when you load a form in a modal?

There was an error with the handling of popups for the last month or so; I just checked in a fix. If you get the latest code, hopefully it will work again. Yaron Koren (talk) 01:33, 18 March 2016 (UTC)

Pipe in free text form input with editor enabled (Warning: OutputPage::getModuleStyles style module should define its position explicitly)

I created a template related form for my wiki user to write some simple "how to" articles.

Those articles might contain technical related matters and unix commands example including pipe character.

The form field where a user can type the description is a free text with editor enabled.

Thankfully, I realized that Yaron Koren latest release of Semantic Forms implements an error handling for a free text field which contains a pipe character not included in double brackets.

For the ones which might be facing the same scenario, I have two possibilities:

1) I can modify the i18n error description and provide further instructions to the users (for example saying that they need to type {{!}} rather than a pipe)

2) I can consider changing the libs/SemanticForms.js in order to automatically replace the pipe character with the template {{!}} something like (you assume all responsabilities if you try this):

....
if ( nextDoubleBracketsStart < 0 || nextPipe < nextDoubleBracketsStart ) {
 // There's a pipe where it shouldn't be.
 //this.addErrorMessage( 'sf_pipe_error' );
 //return false;
 this.find("input, textarea").val(this.find("input, textarea").val().replace(/\|(?![^\({]*})(?![^\(\[]*\])/g,'|');
}
....

The other problem I faced is that with the editor enabled for the free text field I was receiving the error: Warning: OutputPage::getModuleStyles: style module should define its position explicitly: ext.semanticforms.wikieditor ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in ...mediawiki-1.26.2/includes/OutputPage.php at line 623] in ...mediawiki-1.26.2/includes/debug/MWDebug.php on line 300.

As I've cloned the latest version of SemanticForms from the git repository, I don't know if this is related to the my MW version.. in any case, the solution I found is to explicitly specify the position in the registerModules function of includes/SF_Utils.php class.

public static function registerModules( ResourceLoader &$resourceLoader ) {
...
 'ext.semanticforms.wikieditor' => array(
  'localBasePath' => __DIR__,
  'remoteExtPath' => 'SemanticForms',
  'scripts' => '/../libs/SF_wikieditor.js',
  'position' => 'top',
  'styles' => '/../skins/SF_wikieditor.css',
  'dependencies' => array(
  'ext.semanticforms.main',
  'jquery.wikiEditor'
  )
 ),
) );
}
...

Further details can be found [here]

Uniqueness of default value checked when opening form?

Hi Yaron,

It seems that a property being unique for a field with a default value is checked when opening the form. Is that correct?

I have a field with a default value (invoice number) that can be unique when the form is opened and not anymore when the page is saved. I would love it when the uniqueness was checked when saving the page. Is there a way to achieve that? --AdSvS (talk) 13:48, 31 March 2016 (UTC)

I didn't write the "unique" code, but I just checked it, and it does appear to be activated when the form is submitted, not when it's displayed. Which is good, because otherwise it would be a pretty useless feature. What makes you think it's the other way? Yaron Koren (talk) 01:00, 1 April 2016 (UTC)