Extension talk:Page Forms

input type "datetime" loses time zone info on editing
If I have a PageForm defined with a datetime input with "include timezone" set, I can enter the date, time, and timezone and save correctly. However, when I go to edit the page with the form again the timezone gets changed to UTC and the date/time get converted to UTC (I think it may actually change to the server's time zone). I think the issue is related to PF_DateTimeInput.php line 81, as the call to date just takes in the integer timestamp. I wonder if maybe line 69 should be tweaked to use date_create_from_format or some other code to parse out the timezone string from the template value. --PCChris23 (talk) 07:38, 5 October 2018 (UTC)


 * s/date_create_from_format/DateTime::__construct/ should I create an issue in Phabricator? I am not very familiar with PHP or with the codebase of MediaWiki or this extension, but I could try to fix it if this general approach seems reasonable. Or is there some other workaround you can suggest? Thanks, PCChris23 (talk) 06:26, 13 October 2018 (UTC)


 * Sorry about the problem, and that was a good idea on the solution. I just checked in what I think is a fix, using the PHP DateTime class as you suggested. Yaron Koren (talk) 03:09, 15 October 2018 (UTC)


 * Thanks,, that did the trick! --PCChris23 (talk) 23:54, 28 October 2018 (UTC)

Combobox/Text with autocomplete: Possibility for indented items or separators for separating content?
Heya,

is there a possibility to format the content of a combobox or text with autocomplete in a way that it shows indented items (like "*", "**" etc. for "tree" input type)?

If not, is there a way to insert a horizontal rule or a blank line in order to group the list items?

Thank you!

--Sochin67 (talk) 20:06, 5 October 2018 (UTC)


 * Unfortunately, no. Yaron Koren (talk) 20:20, 5 October 2018 (UTC)


 * Okay - thank you, Yaron! --Sochin67 (talk) 20:31, 5 October 2018 (UTC)

Set custom attr or ID on a field
I'm writing some pre-save errorchecking for a form in JS, and it would be really convenient if I could define an attribute like  for each field, particularly for dropdowns but also in general. Could something like  be added as an available option for any input field if it's straightforward enough to do? Similar for setting a custom ID. --RheingoldRiver (talk) 09:34, 10 October 2018 (UTC)


 * What about just putting a "div" or "span" tag around the input, and setting one or more classes for it - would that be good enough? Yaron Koren (talk) 15:51, 10 October 2018 (UTC)


 * I have 7 sets of data that correspond to different stats, and some of the fields are dropdowns so I have to monitor their values with .change. So what I'm able to do is pretty awkward if I want to do any kind of for loop. If I could set an attr I could look up its value and then define what changed with that as the key, and it would be a lot cleaner. But yeah this request is probably only needed for dropdowns, for any other input type I think just a parent class is fine (and has been so far). --RheingoldRiver (talk) 21:47, 10 October 2018 (UTC)

Bug with "show on select" radiobutton labels when using Multiple instances
Hi Yaron, hi Friends,

I am using Page Form [REL1_31 (June 24)] (Maybe this bug has already been fixed, if yes, sorry for that..)

When I use "show on select" with radiobuttons when using Multiple instances, the label of the radiobuttons are not clickable on every instance.

I have noticed that:
 * When I formedit a page, for each new multiple instance added, the radiobutton's labels have a "For" target empty (in that case the label is NOT clickable because the For is empty)
 * When I save the page and go back to formedit, the radiobutton's labels of the pre-existing instances doesn't have a "For" target at all (in that case the label is clickable)

I assume the best way to fix this is to add a target to each "For". Am I doing something wrong? Have you seen that bug before?

Thanks a lot --ClemFlip (talk) 10:15, 11 October 2018 (UTC)


 * Okay, I just checked in a fix for this (with your help :) ). Yaron Koren (talk) 19:09, 26 October 2018 (UTC)

Bug in fields textarea with editor = wikieditor: the field can not be empty.
Hi there, With PageForms 4.3.1, a textarea field with editor=wikieditor generates a bug when the field isn't filled : "« | » is not allowed except inside or ...."  --Megajoule (talk) 09:01, 12 October 2018 (UTC)


 * Is the problem still there in PF 4.4? Yaron Koren (talk) 04:45, 14 October 2018 (UTC)

Textarea on multiple-instance templates while using IE turns placeholder text in to actual text
Hello!

When using the multiple-instance template and setting a field to use the "textarea" input type, the placeholder text (in the "textarea") populates as actual text. This only seems to happen on Internet Explorer, is there a way to fix this?

I'm experiencing this on:
 * MW: 1.31.1 (a4c8065)
 * SMW: 2.5.8
 * PF: 4.4-rc1 (b4c29bd)

Thanks in advance,

V brooks (talk) 18:12, 18 October 2018 (UTC)


 * Yes, that's a known problem, already listed here. Is there any way you can upgrade to MS Edge? Yaron Koren (talk) 19:03, 18 October 2018 (UTC)


 * Sounds good, majority of my users use Chrome so I'll suggest the IE users to use Chrome for now. Thanks! --V brooks (talk) 15:46, 19 October 2018 (UTC)

mapping cargo table ampersand encoding
If I have a cargo table "sweets" with a field "sweetName" and if I have a form that allows you to pick a sweet from this list like this...

M&Ms would be displayed as M&amp;amp;Ms in the option list. i.e

Have I missed a trick or is there a bug? JamesDriscoll (talk) 17:29, 1 November 2018 (UTC)


 * Further to this problem, I think I've tracked the issue down to double encoding in PF_DropdownInput::getHTML

Here is a fix for my own use case but I dont' know enough about the code to know if $label will also need decoding on line 91 and there may be similar issues in other forminputs.

If $label also needs decoding on line 91 maybe changing $innerDropdown .= Html::element( 'option', $optionAttrs, $label ); to $innerDropdown .= Html::rawElement( 'option', $optionAttrs, $label ); will have the desired outcome without having to call html_entity_decode?

I hope this helps JamesDriscoll (talk) 10:46, 10 November 2018 (UTC)

Create Property link missing
Hi

I have several installations of MediaWiki with Page Forms installed on all of these installations.

But one of the installations I am not seeing the create property link. I have run the update script, but still not seeing anything.

Not sure what I have done wrong.

Any help is appreciated.

Gary

--Squeak24 (talk) 13:04, 2 November 2018 (UTC)


 * It only shows up if Semantic MediaWiki is installed on that wiki. Yaron Koren (talk) 13:49, 2 November 2018 (UTC)


 * Thanks Yaron, I have Semantic MediaWiki installed, but it still isn't showing. The only SMW related extension I don't have installed at the moment is Semantic Compound Queries. Do I need that installed as well?

This is what I have so far:

--Squeak24 (talk) 10:22, 7 November 2018 (UTC)


 * What version of Page Forms are you running? Yaron Koren (talk) 17:13, 7 November 2018 (UTC)

WikiEditor strange timing bug
I'm trying to track down a bug where the wikieditor doesn't always display the file upload and other icons on a form edit. instead of



it's opening like this



I discovered an error that I'm hoping is related(though I'm not entirely convinced) the console is reporting

the offending line in PageForms.js is   called from (in PageForms.js)

with a param of null in this...

including &purge=true&debug=true in formedit url is very likely to repeat the bug. I've never got the icons to fail to load on a action=edit ,it's only happening on pageforms action=formedit. I hope this is usful info

JamesDriscoll (talk) 11:59, 3 November 2018 (UTC)

$wgPageFormsAutocompleteOnAllChars = true; not working?
I have not tried earlier versions but since 4.3 minimum and every later version on php 5.6 setting this configuration parameter has no effect. I can only autocomplete on the first chars of a word and not on chars within a word. --91.64.58.124 16:13, 7 November 2018 (UTC)


 * I just tried it - it looks like it works with the "tokens" and "combobox" input types, but not with "text with autocomplete". What input type(s) are you trying it with? Yaron Koren (talk) 17:20, 7 November 2018 (UTC)


 * Yes, I am using it with "text with autocomplete". --91.64.58.124 19:43, 7 November 2018 (UTC)


 * Alright - well, this is a bug that should be fixed. I should note that I've been thinking for a long time of getting rid of "text with autocomplete" (and "textarea with autocomplete"), keeping just "tokens" and "combobox". I would recommend switching one of those two, since I think their interface is better anyway. Yaron Koren (talk) 20:29, 7 November 2018 (UTC)


 * At least "tokens" does not work as a way out. No acceptance for it from the editors and it is not working on skin Foreground. I will have to look at "combobox" but in the end I do not like to loose "text with autocomplete" and "textarea with autocomplete" at all. These are the best to use. --91.64.58.124 21:33, 7 November 2018 (UTC)