Extension talk:Semantic Forms

From MediaWiki.org
Jump to: navigation, search
An archive box Archives 

Cargo and Values from Category[edit source]

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[edit source]

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`. 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[edit source]


| {{{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[edit source]

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[edit source]

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[edit source]

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?[edit source]

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[edit source]

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"[edit source]

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[edit source]

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?[edit source]

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.[edit source]

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[edit source]

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[edit source]

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

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[edit source]


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
| 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
|{{#formlink:form=Archi|link text=[[File:edit.png|link=]]|target={{{1|}}} }}

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


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