Extension talk:Page Forms

multi instance template Spreadsheet-style editing
I have multi instance template and have a couple of issues.


 * Date Picker does not seem to work. Is this possible?
 * Can I add PlaceHolder text?
 * The headings are the field name not the title. Is there a way to fix that?
 * Thanks, --Legaulph (talk) 16:53, 1 March 2018 (UTC)


 * The answer to the first two questions is "no", unfortunately. What do you mean by the title? Yaron Koren (talk) 17:01, 1 March 2018 (UTC)


 * The Headings in the top bar |--Legaulph (talk) 17:54, 1 March 2018 (UTC)


 * I don't understand the question, then. Yaron Koren (talk) 18:01, 1 March 2018 (UTC)


 * So if I have

{{{ ! Start date: }}}
 * {{{field
 * start date
 * input type=text
 * mandatory
 * date format=mm/dd/yy
 * Start date: does not show for the heading it displays start date from field name. --Legaulph (talk) 18:16, 1 March 2018 (UTC)


 * Oh, I see. You can set it manually by adding a "|label=" parameter to the field tag. Yaron Koren (talk) 03:24, 2 March 2018 (UTC)
 * That works, Thanks. --Legaulph (talk) 11:55, 5 March 2018 (UTC)

Missing two listboxes... (part 2)
Hello, Sorry to reopen the "Missing two listboxes" topic. Yaron Koren asked «Do you still think "two listboxes" has advantages over "tokens"?"». Yes, I do! The difference between "two listboxes" and "tokens" is the same as between "text with autocomplete" and "combobox". Users prefer to select an item from a list rather than type it. Furthermore, "two listboxes" is better than the "listbox" input because users do not necessarily know that the control key allows to select several values ... So I vote for the introduction of the "two listboxes" input in the "Page Forms" extension. Please do, semantic master, millions (billions ?) of users humbly are asking you. By the way, great job Yaron for all your work! --Megajoule (talk) 15:35, 9 March 2018 (UTC)


 * Thanks, and I'm pretty sure my software doesn't have millions of users. :) What about "two listboxes" vs. "checkboxes"? Yaron Koren (talk) 16:01, 9 March 2018 (UTC)


 * Hmm... Nice try but I'm not sure that "checkboxes" is the most appropriate input if you use "values from category=some category" whereas some category has millions (um, hundreds...) of pages... --Megajoule (talk) 22:27, 9 March 2018 (UTC)


 * I don't understand - would "two listboxes" work with hundreds of values? Yaron Koren (talk) 14:05, 11 March 2018 (UTC)


 * Yes, indeed. I've just tried a "two listboxes" input with 973 pages in the category. And it works perfectly. --Megajoule (talk) 18:00, 14 March 2018 (UTC)


 * Well, I should have worded it better. I'm not surprised that it works, it just seems very unwieldy to have a "two listboxes" input with hundreds of values, where you have to keep scrolling up and down to find different values. Do you really think "two listboxes" is easier to use than either "tokens" or "checkboxes" with that many values? Yaron Koren (talk) 18:18, 14 March 2018 (UTC)


 * The choice in "two listboxes" is restricted, which is often necessary : you can't type a "fanciful" value. And either you can go through the list or you can use the autocompletion field. This option makes it easy to fill a basket. In short, users like it. --Megajoule (talk) 21:42, 14 March 2018 (UTC)--

Oh yeah, I forgot that "two listboxes" had an autocompletion helper feature. Though I should note that in the "tokens" input you can use "existing values only" to prevent users from creating new values. But I'm curious about the last thing you said - "users like it". This is a lot to think about, because as far as I remember you're the first person who has asked for "two listboxes" to come back since it went away around September 2016 (even in the discussion you linked to, the person didn't really seem bothered by the switch to "tokens"). Without getting into too many details, roughly how many people have you heard expressing an opinion on this? Yaron Koren (talk) 00:30, 15 March 2018 (UTC)


 * OK, you convinced me. I'll manage with "tokens" and try to carry out effective change management with my users... Thanks. Megajoule (talk) 08:54, 29 March 2018 (UTC)

Hello again... How should I do with tokens so that a possible value can only be selected once (as in two list boxes ...)? -- Annoying Megajoule (talk) 17:20, 13 April 2018 (UTC)


 * Unfortunately, there's no way (short of modifying the code), though it would indeed be nice if selected values got removed from the set of possible values. Yaron Koren (talk) 01:57, 16 April 2018 (UTC)

Radio button
Hi!

I have big problem with Radio buttons. Imported the Template:Location map from wikipedia, everything work great but selection of multiple maps doesn't work at all.

I was trying all different solutions but nothing seems to work. http://escforumwiki.com/index.php?title=Template:Location_map#User_selection_of_multiple_maps --Tymek1988 (talk) 00:05, 14 March 2018 (UTC)


 * Could you link to a form where the problem can be seen? I don't understand how that page you linked to is related. Yaron Koren (talk) 00:26, 14 March 2018 (UTC)


 * its releted because it shows that it doesn’t work, I don’t get any error message. This how it looks in wikipedia: https://en.wikipedia.org/wiki/Template:Location_map#User_selection_of_multiple_maps and that’s mine: http://escforumwiki.com/index.php?title=Template:Location_map#User_selection_of_multiple_maps--Tymek1988 (talk) 08:53, 14 March 2018 (UTC)


 * Is this a question related to the Page Forms extension? You do have Page Forms installed on your wiki, but it doesn't look like you have any forms defined. Yaron Koren (talk) 16:18, 14 March 2018 (UTC)


 * After little search I found that I need Template:Switcher and MediaWiki:Common.js, still doesn't work tho, but hope I will find the problem soon --Tymek1988 (talk) 22:44, 14 March 2018 (UTC)

TinyMCE
Hi Yaron, hope all is good! I have just installed TinyMCE onto my development server, but I can't seem to figure out how to get it working on the Page Forms. Where do I place the "editor=tinymce"? I have tried in the form, or is it in the backend extension files?

Any help would be appreciated.

Gary --Squeak24 (talk) 11:34, 16 March 2018 (UTC)


 * You have to put in the "field" tag in the form definition - it should work for any textarea input. Yaron Koren (talk) 12:55, 16 March 2018 (UTC)


 * Brilliant, thank you. --Squeak24 (talk) 13:24, 16 March 2018 (UTC)

Default value in a "datetimepicker' or "datepicker" field
Hello, In a previous version of SMW I used  in a "datetimepicker" field or   in a "datepicker" field. It seems it doesn't work anymore: the "#time" parser function is not systematically evaluated:  could be a solution but the time value (H:i) is missing... Megajoule (talk) 08:48, 29 March 2018 (UTC)


 * Sorry about that - I just checked in what I think is a fix for this. Yaron Koren (talk) 17:04, 6 April 2018 (UTC)


 * Thank you for your quick reaction. I just tested: it works for a datepicker field but for a datetimepicker field, it is the "now" string that is saved:  where date1 is a datepicker field and date 2 is a datetimepicker field. Megajoule (talk) 17:46, 13 April 2018 (UTC)


 * Are you using the latest version of the code? Yaron Koren (talk) 21:38, 13 April 2018 (UTC)


 * Yes I am.  works well in the form : now is well replaced by the current date and time. But after validating the form,   is saved in the page. Megajoule (talk) 17:51, 14 April 2018 (UTC)


 * Sorry about that. I neglected to do a full test of my fix. I just checked in a further fix that I think takes care of the issue. Yaron Koren (talk) 02:51, 18 April 2018 (UTC)


 * Thank you Yaron. Megajoule (talk) 07:11, 18 April 2018 (UTC)


 * I just tested the new version 4.3.1. It works perfectly! Thanks again. Megajoule (talk) 16:56, 29 April 2018 (UTC)

"values from concept" only works if $wgPageFormsUseDisplayTitle=false
About this topic: I confirm that "values from concept" doesn't work except if $wgPageFormsUseDisplayTitle is set to false (true by default). Megajoule (talk) 09:44, 29 March 2018 (UTC)

wpRunQuery=true doesn't work in PF 4.3
Using MW 1.29, updated PF to 4.3: wpRunquery=true stops working. Query field is correctly set but query isn't run. Back to 4.21, things run as expected. Steph.


 * Oops - I did change around some variables, forgetting about the "wpRunQuery=true" query string option. I just added a new setting to replace the old one - instead of adding "wpRunQuery=true", you now just need to add "_run" by itself. Sorry about the problem. Yaron Koren (talk) 03:45, 9 April 2018 (UTC)

How to link to form that creates pages in a namespace?
this is for the sidebar. This is the correct link we need to get to: https://gunretort.xyz/index.php/Form:Retort?namespace=Draft

based on the manual... https://www.mediawiki.org/wiki/Extension:Page_Forms/Linking_to_forms#Using_#forminput

...i tried this on a page:

which directed to: https://gunretort.xyz/index.php/Special:FormEdit/Retort?%22namespace=Draft%22

which returned a database error. Not even sure i can use curlies in the sidebar.

i tried this in the sidebar: Form:Retort?namespace=Draft|New Retort

but for some reason, it resolves incorrectly to: Form:Retort%3Fnamespace%3DDraft

Temporarily, i put the entire url into the sidebar: https://gunretort.xyz/index.php/Form:Retort?namespace=Draft

but of course that's not the right way to do it. It has 2 issues:
 * if my domain changes (which it might) this will break.
 * if i have my wiki set to open links in new windows (which i do), then this opens in a new window (which it shouldn't)


 * First of all, it should be "query string=namespace=Draft", not "query string="namespace=Draft" ". But that's not really relevant here, because those instructions are for #forminput; #formlink doesn't have a "namespace" option. Instead, "Draft:" should be added to the page name formula in the form. Yaron Koren (talk) 00:56, 9 April 2018 (UTC)

Based on the manual, i get something like: Where, in the formula, do you put the User-input? Do i have to make this a field in the Template? -Thx PS- Thx for all your development of incredible mediawiki extensions!


 * Thanks! Oh, I thought before that you already had a page name formula, given that you were using #formlink. Since you're not, I think you just need to use #forminput instead of #formlink (and get rid of those quotation marks), and the whole thing will work. Yaron Koren (talk) 02:29, 9 April 2018 (UTC)


 * jw: But i want a link, not an input-box. Isn't #forminput an text-input-box? Are you saying i can put namespace or prefix in the #forminput that's in the form? Or maybe put namespace or prefix in the Save button? -thx


 * If you want a link, then you definitely need a page name formula. See here for one example of a page name formula in use. Yaron Koren (talk) 03:57, 9 April 2018 (UTC)


 * jw: hey, my infotag was pretty close. In your example, i see one input on the 1st screen, where the page-name is entered. I'm not seeing how that one input box gets loaded into the page-name. i the magic might happen in PF_Form.php


 * This works, but not: I made a page called New_Retort. It contains: . That works.


 * Solved! I figured out that your form-wizard makes a form which is self-referential. It puts the form and the forminput which calls that form on the same page. All this time i was trying to create a forminput on another page that points to the form which already contains forminput.


 * No page name formula needed.


 * Fyi, if you label a link in your sidebar as "New Page", it will break the sidebar (nothing to do with Extension:Page_Forms).

namespace query parameter doesn't work
https://mydomain.com/index.php/Form:Retort?namespace=Draft

should create a page in the "Draft" namespace, i think. It doesn't.

any fix?


 * See above. Yaron Koren (talk) 01:02, 9 April 2018 (UTC)

Embeding Special:RunQuery on a page is generating an error

 * MediaWiki	1.30.0
 * PHP	7.1.8 (apache2handler)
 * Semantic MediaWiki	2.5.6
 * Page Forms	4.3 (624f2a9) 18:20, 16 January 2018


 * MediaWiki internal error.


 * Original exception: [WsznpY93tCo5DbDx4XRdJwAAAAM] 2018-04-10 16:34:45: Fatal exception of type "MWException"


 * Exception caught inside exception handler.


 * Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information.


 * Upgraded to PageForms 4.3 and get error

[Ws5Q-Z3aU0dVxecP9WjFDAAAAAU] /index.php/LADR_Downloads_and_Statistics TypeError from line 46 of /app/mediawiki/extensions/SemanticMediaWiki/includes/formatters/MessageFormatter.php: Argument 1 passed to SMW\MessageFormatter::__construct must be an instance of Language, instance of StubUserLang given, called in /app/mediawiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php on line 89

Backtrace:

This is still just with the embedded query page -- Legaulph (talk) 18:20, 11 April 2018 (UTC)
 * 1) 0 /app/mediawiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(89): SMW\MessageFormatter->__construct(StubUserLang)
 * 2) 1 /app/mediawiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(291): SMW\ParserFunctionFactory->newAskParserFunction(Parser)
 * 3) 2 /app/mediawiki/includes/parser/Parser.php(3383): SMW\ParserFunctionFactory->SMW\{closure}(Parser, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string)
 * 4) 3 /app/mediawiki/includes/parser/Parser.php(3106): Parser->callParserFunction(PPFrame_DOM, string, array)
 * 5) 4 /app/mediawiki/includes/parser/Preprocessor_DOM.php(1229): Parser->braceSubstitution(array, PPFrame_DOM)
 * 6) 5 /app/mediawiki/includes/parser/Parser.php(2921): PPFrame_DOM->expand(DOMElement, integer)
 * 7) 6 /app/mediawiki/includes/parser/Parser.php(1277): Parser->replaceVariables(string)
 * 8) 7 /app/mediawiki/includes/parser/Parser.php(451): Parser->internalParse(string)
 * 9) 8 /app/mediawiki/includes/content/WikitextContent.php(329): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
 * 10) 9 /app/mediawiki/includes/content/AbstractContent.php(516): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
 * 11) 10 /app/mediawiki/includes/poolcounter/PoolWorkArticleView.php(144): AbstractContent->getParserOutput(Title, integer, ParserOptions)
 * 12) 11 /app/mediawiki/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork
 * 13) 12 /app/mediawiki/includes/page/Article.php(585): PoolCounterWork->execute
 * 14) 13 /app/mediawiki/includes/actions/ViewAction.php(68): Article->view
 * 15) 14 /app/mediawiki/includes/MediaWiki.php(499): ViewAction->show
 * 16) 15 /app/mediawiki/includes/MediaWiki.php(293): MediaWiki->performAction(Article, Title)
 * 17) 16 /app/mediawiki/includes/MediaWiki.php(851): MediaWiki->performRequest
 * 18) 17 /app/mediawiki/includes/MediaWiki.php(523): MediaWiki->main
 * 19) 18 /app/mediawiki/index.php(43): MediaWiki->run
 * 20) 19 {main}


 * Very interesting - that seems like an SMW error. I don't know if I can help with this... Yaron Koren (talk) 18:34, 11 April 2018 (UTC)

What's the index or named-constant for the Form namespace?
PF_NS_FORM. Yaron Koren (talk) 13:20, 11 April 2018 (UTC)

How to use VE in "free text area" when "edit with forms"
Hi Yaron,

When using a form to edit a page there is the option of keeping the "free text" area.

How does one get the form edit page to use Visual Editor for the Free Text area?

ty -Rich


 * There's currently no way to do it, although there might be one coming soon. Yaron Koren (talk) 13:20, 11 April 2018 (UTC)

ok. thanks. Are you following Extension:VEForPageForm? .. any thoughts on weather or not this extension is doing things in a way that Page Forms may someday include? (re: Topic:Ub2nfjjlhm8gfdwq)


 * Yes - that extension's code would most likely be getting used in one way or another. Yaron Koren (talk) 14:33, 11 April 2018 (UTC)

Bug? Form doesn't like an article-name.
I've created several pages with my form, no prob. But this particular name returns an error: "All governments are tyrannical by nature. "

= Internal error = [Ws67PpT2BBCEdzFEIF@mHwAAAVQ] /index.php/Special:FormStart?page_name=All+governments+are+tyrannical+by+nature.+&form=Retort&namespace=Draft Wikimedia\Assert\ParameterAssertionException from line 63 of /home/gunsywtx/public_html/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $dbkey: invalid DB key 'FormEdit/Retort/Draft:All_governments_are_tyrannical_by_nature._' Backtrace:
 * 1) 0 /home/gunsywtx/public_html/includes/title/TitleValue.php(82): Wikimedia\Assert\Assert::parameter(boolean, string, string)
 * 2) 1 /home/gunsywtx/public_html/includes/specialpage/SpecialPage.php(100): TitleValue->__construct(integer, string, string)
 * 3) 2 /home/gunsywtx/public_html/includes/specialpage/SpecialPage.php(84): SpecialPage::getTitleValueFor(string, string, string)
 * 4) 3 /home/gunsywtx/public_html/includes/specialpage/SpecialPage.php(629): SpecialPage::getTitleFor(string, string)
 * 5) 4 /home/gunsywtx/public_html/extensions/PageForms/specials/PF_FormStart.php(130): SpecialPage->getPageTitle(string)
 * 6) 5 /home/gunsywtx/public_html/extensions/PageForms/specials/PF_FormStart.php(164): PFFormStart::getFormEditURL(string, string)
 * 7) 6 /home/gunsywtx/public_html/extensions/PageForms/specials/PF_FormStart.php(81): PFFormStart->doRedirect(string, string, NULL)
 * 8) 7 /home/gunsywtx/public_html/includes/specialpage/SpecialPage.php(522): PFFormStart->execute(NULL)
 * 9) 8 /home/gunsywtx/public_html/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(NULL)
 * 10) 9 /home/gunsywtx/public_html/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
 * 11) 10 /home/gunsywtx/public_html/includes/MediaWiki.php(851): MediaWiki->performRequest
 * 12) 11 /home/gunsywtx/public_html/includes/MediaWiki.php(523): MediaWiki->main
 * 13) 12 /home/gunsywtx/public_html/index.php(43): MediaWiki->run
 * 14) 13 {main}

Solved: Page_Forms doesn't like trailing spaces in article name.

Request: do RTrim and LTrim on the entered name.

Cheers!


 * Good idea - I added in a fix for this a few days ago. Yaron Koren (talk) 01:56, 16 April 2018 (UTC)


 * Thx! Github master? Johnywhy (talk) 20:56, 25 April 2018 (UTC)


 * That would work, although there's also been a new version of Page Forms out in the meantime. Yaron Koren (talk) 21:07, 25 April 2018 (UTC)

147 Lines of Errors when using a form
Im getting 147 lines of errors when I load a form to edit or save a form. Its the following three errors repeated. --Cody3647 (talk) 15:32, 13 April 2018 (UTC)
 * PHP Warning: Missing argument 9 for CargoSQLQuery::newFromValues, called in /wiki/extensions/PageForms/includes/PF_ValuesUtils.php on line 136 and defined in /wiki/extensions/Cargo/includes/CargoSQLQuery.php on line 42
 * PHP Notice: Undefined variable: offsetStr in /wiki/extensions/Cargo/includes/CargoSQLQuery.php on line 47
 * PHP Notice: Undefined variable: offsetStr in /wiki/extensions/Cargo/includes/CargoSQLQuery.php on line 78
 * Nevermind, not sure if maybe I had mismatched versions but Ive updated both via git and the errors are gone.--Cody3647 (talk) 14:51, 14 April 2018 (UTC)

Accessing data from a field across Page Forms using mysql
I am trying to access data saved to a specific textarea field across several Page Forms using a mysql call, but I can't seem to find where the Page Forms data is stored in my mysql wiki database. Does anyone know where it is stored? Or, better yet, is there an easier way to pull that data so I can drop it into a javascript-powered (D3.js) chart on a Special page?


 * The data doesn't get stored anywhere, unless you use either Cargo or Semantic MediaWiki to store it. I would definitely recommend using one of those, if you're not already. Yaron Koren (talk) 12:15, 20 April 2018 (UTC)


 * That's the info I needed. I'll go with Cargo. Thanks for the assist! Mdav109 (talk) 10:28, 21 April 2018 (UTC)

Format Form Output?
I'm curious to know how to format the form's output in a wiki page. For example, when the form is filled there are no spaces between the pipe, parameter, and parameter value.

Ex.

How do I format the output so that there are spaces between the pipe, parameter, and value?

Ex.

I'm asking because this is the format in which all of my wiki's pages are formatted. Thanks for any help. Monochromatic Bunny (talk) 18:44, 22 April 2018 (UTC)


 * There's no setting for that; you'd have to do it in the code. If you were going to change the code, this looks like the line that needs to change. Yaron Koren (talk) 01:56, 23 April 2018 (UTC)

Use Form to add to page, without having other templates visible
Hi, I'd like to have a page "Travels", starting with a form that allows to add basic information about a specific voyage. Following on the same page should be all the entries people made. Can I use  in a page? How can I make the form only add to a page in the beginning or end, but not edit the whole page? Best regards, Heinrich


 * There may be a way to do what you're talking about, but I would recommend that each specific voyage get its own page - and then the "Travels" page would just query all those voyages. It makes both editing and display easier, I think. And you can use a popup form within the "Travels" page to create the other pages, so that users don't have to leave that page. Yaron Koren (talk) 18:43, 25 April 2018 (UTC)


 * But wouldn't that create an awful lot of pages when semantic subobjects would suffice?
 * Anyway, it seems that if I use "multiple" with forms the "token" input field don't show a proper pulldownmenu anymore. That is sad, so I might have to work with subpages. Heinrich krebs (talk) 09:42, 26 April 2018 (UTC)

A couple of issues with PageForms 4.3 and 4.3.1

 * MediaWiki	1.30.0
 * PHP	7.1.8 (apache2handler)
 * MySQL	5.6.34-log
 * Page Forms	4.3.1 (624f2a9) 18:20, 16 January 2018


 * 1) Date Picker Today button does not enter today's date and is grayed out when you first open the picker. This seems to work when the date has already been set to another date and it brings you to today's date and still does not enter it into the field.
 * 2) Show preview "Go to editing area" link does not work
 * 3) In one of my forms when editing a page I get "Page Forms error: backtrace limit exceeded during parsing! Please increase the value of pcre.backtrack_limit in php.ini or LocalSettings.php."
 * 4) * I was able to resolve this by increasing
 * [Pcre]
 * PCRE library backtracking limit.
 * http://php.net/pcre.backtrack-limit
 * pcre.backtrack_limit=5000000

--Legaulph (talk) 12:00, 26 April 2018 (UTC)

How to Pass forminput to Template?
My template is called Template:Tag. It contains:

My form contains: ...

...

...

How to load the name of the new page into the `MyParam` parameter of the template? thx Johnywhy (talk) 04:29, 11 May 2018 (UTC)


 * I don't think it's possible, though I don't think it's necessary either. Yaron Koren (talk) 14:00, 29 April 2018 (UTC)

Form edit with empty fields
I have a strange behavior with PageForms > 4.2. If a Template to be edited starts right at the beginning of a page all fields are displayed empty. It there is at least one newline it works as expected. Version 4.2 does not have this problem. Again I am forced to go back to version 4.2. Example: Form edit does not work. FormEdit does work. --WolfgangFahl (talk) 16:34, 1 May 2018 (UTC)


 * Does this happen with the latest version of the code? And does it happen with all the forms on your wiki, assuming you have more than one? Yaron Koren (talk) 22:57, 1 May 2018 (UTC)

Yes - it happens with all my forms that do not have a new line. And it is not the only regression of 4.3.1. The datepicker fields also do not work at all. For me 4.3.1 is a no go - in my enviroment it is broken to an extent that it makes it unusable. Can we do something about the testing of new versions to make such a situation avoidable? I'll not be able to report problems if I have to go back to an older version. --WolfgangFahl (talk) 05:46, 5 May 2018 (UTC)


 * That empty-field problem sounds quite bad. You're the only person I've heard from who's experienced this problem, so it may be a challenge to debug. I'm guessing that it's due to some specific aspect of your wiki setup, like a combination of extensions or something. What version of MediaWiki are you running? And is this a public wiki?
 * As for the datepicker problem - in forms where it's not working, do you see any error messages in the JavaScript console?
 * I agree that it would be great to have more testing of Page Forms versions before they're released. Are you offering to help with the testing of future versions? If so, I'll be glad to take you up on that offer. Yaron Koren (talk) 04:39, 6 May 2018 (UTC)


 * I had this issue on one wiki using 4.3 too and migrated to input type date to help the cause. --&#91;&#91;kgh&#93;&#93; (talk) 15:00, 25 May 2018 (UTC)


 * What issue? Yaron Koren (talk) 15:10, 25 May 2018 (UTC)


 * Sorry, I posted a the wrong spot. --&#91;&#91;kgh&#93;&#93; (talk) 15:12, 25 May 2018 (UTC)


 * I did not but I should have been more clear. I meant the datepicker input type being broken. The report indeed mixes serveral issues. :| --&#91;&#91;kgh&#93;&#93; (talk) 15:14, 25 May 2018 (UTC)


 * Do you see any error messages in the JavaScript console? Yaron Koren (talk) 15:55, 25 May 2018 (UTC)

wikitable
Unable to use wikitables within page forms.

"|" is not allowed, except within or ...


 * Yes - to include a table, you'll have to use " | " instead of "|" - or only include tables in the free text input, or section inputs. Yaron Koren (talk) 04:41, 6 May 2018 (UTC)

Bug with partial forms and multi-instance templates
If I use a multi-instance template in a partial form, I have a bug: my templates are duplicated two or three times.

Example with a template "Sitographie". I have this template instanced two times (no bug for the moment):

I want to instance it a third time. Here is the result:

There's 6 and not 3 instances of the template!

If I erase the  code at the beginning of the form, no more bug... But I need to use this form as a partial one. Do you know this issue? --Manu.wikidebats (talk) 21:48, 5 May 2018 (UTC)


 * I don't know this issue, but I'm not surprised that there are problems with partial forms - there have always been some problems with them. Why does this need to be a partial form? Yaron Koren (talk) 04:45, 6 May 2018 (UTC)


 * I prefer to use partial forms in one page rather than to create several subpages (one per form). That prevents in particular some difficulties when renaming a page -- no redirection needed. Or do you think I can avoid these problems even with regular forms? --Manu.wikidebats (talk) 18:50, 6 May 2018 (UTC)
 * You can make a "pseudo-partial" form by putting into it all the other templates (there might be just one other one), but leaving them blank, i.e. without any fields. If that makes sense. Yaron Koren (talk) 03:20, 7 May 2018 (UTC)

Issue with partial forms and embedded multi-instance templates
I need to embed a multi-instance template in a template, like this:

Unfortunately, if these templates are used in a partial form, Page Forms changes the structure in:

The Template 2 is not really embedded...

Why is it necessary to use a "regular" form to achieve what I need? Namely:

Thank you for your help--Manu.wikidebats (talk) 22:04, 5 May 2018 (UTC)


 * See above, I guess. Yaron Koren (talk) 04:46, 6 May 2018 (UTC)

Warnings
Just reporting the folowing warnings in Page Forms 4.3.1 (a3c23fe).

Warning: asort expects parameter 1 to be array, object given in /extensions/PageForms/includes/PF_ValuesUtils.php on line 638

Warning: array_unique expects parameter 1 to be array, object given in /extensions/PageForms/includes/PF_ValuesUtils.php on line 639. Jaider msg 01:46, 7 May 2018 (UTC)


 * There's already a Phabricator bug for this here - I still don't know what the cause is. Yaron Koren (talk) 03:21, 7 May 2018 (UTC)
 * Oh, ok. I think it is related to $wgPageFormsUseDisplayTitle. When I change this variable value to false, the warnings don't appear. Jaider msg 13:15, 7 May 2018 (UTC)

[Solved] Freetext Syntax is Unclear
This section makes it seems that Freetext a "tag", which takes parameters. That means it should begin: {{{freetext...

But this section sounds like "standard input" is a a tag, and freetext is a parameter passed to it: {{{standard input|freetext...

i tried this, and didn't work: {{{freetext|preload=Tag/preload}}}

Can someone '''please explain. '''

{{unsigned|Johnywhy|01:10, 10 May 2018}}


 * {{re|Johnywhy}} You're right, the "free text input" is the 'standard input' tag with the 'free text' first paramter. Sam wilson 01:19, 10 May 2018 (UTC)


 * {{re|Samwilson}} thx, Can you please share an example? The following doesn't work for me:

{{{standard input|freetext|preload=Tag/preload}}}

i suggest This section be revised for clarity. I applied your verbiage. Johnywhy (talk) 12:03, 10 May 2018 (UTC)


 * Solution:

{{{standard input|free text|hidden|preload=Template:Tag/Preload}}} note spaces in "standard input" and "free text". Be sure not to place into "noinclude" section.

Please Improve Documentation
As someone new to mediawiki dev, i really struggle with your manual because there are almost no examples. Please add an example to each section.

I added some info to your manual, but my info is not correct. Hope someone has a chance to fix it: https://www.mediawiki.org/wiki/Extension:Page_Forms/Defining_forms#Form_markup_language

i put an empty example here: https://www.mediawiki.org/wiki/Extension:Page_Forms/Defining_forms#'info'_tag thx


 * Sorry, I only just saw your comment here, after I reverted your change to Extension:Page_Forms/Defining_forms. Apologies if I was hasty. I think discussion should happen here first though, about what's not clear, because certainly things like explaining the format of parser functions (i.e. the two braces and a hash) vs template parameters (the three braces) do not belong in PageForms documentation (because they are general to MediaWiki and have their own documentation pages). Perhaps a simple boilerplate for each tag is required, that shows all parameters and is easily copyable? Similar to what is done in Using #forminput. Would that suffice? Sam wilson 01:13, 10 May 2018 (UTC)


 * Glad you reverted my changes, i know they were incorrect-- just meant to show my confusion. The following would be helpful:


 * Boilerplate examples similar to what is done in Using #forminput would be great.
 * Explanation of the distinction between parser functions, template parameters, and pageforms tags.
 * Order in which tags can appear in the form def.
 * Possibly restructure the entire help doc.
 * Eg, if FreeText is a subset of StandardInput, then Section 4-The free text input should be moved under 'standard input' tag. For me, it's very confusing if the structure of the doc doesn't reflect the structure of syntax. To demonstrate, i did the move-- feel free to revert or improve.
 * Why isn't freetext listed on InputTypes page? Isn't it one of the input-types? If yes, it should included. If no, then the difference should be explained.
 * In some places, freetext is referred to as "free text". In other places, as "freetext". That's inconsistent. Should be consistent. I think the intended grammar is "free text" is english, and "freetext" is code, which may be fine. But is that dual usage necessary? Or just confusing? Is it done consistently?
 * Section tag mentions that it's params can also be used for freetext. But the freetext section does not mention that it's parameters can be used for Section tag. That's inconsistent. Mention in both places, or neither. If parameters listed on here are also used for the "textarea" input type and the free text input, then maybe those parameters should be listed in just one common place, instead of all three places.
 * Other inputs that can be used with StandardInput should be mentioned in the StandardInput tag. I added that.

Many thx Johnywhy (talk) 11:57, 10 May 2018 (UTC)

[Solved] How To Preload?
Just need example code. The following doesn't work for me:


 * Solution:

note spaces in "standard input" and "free text". Be sure not to place into "noinclude" section.

Insert custom wikitext when form generates page
I've made a form that describes a person's bio. I'd like for the resulting bio page to have a Cargo query at the bottom listing all the entries in the wiki that reference that person. However, when I try to do this by putting the required Cargo query (or any text) into the "includeonly" tags of the bio form, the text is stripped away in the final page. Is it possible to automatically insert custom wikitext -- e.g. a Cargo query -- at the bottom of a form?


 * Let me note that these kinds of "aggregating" queries are usually put in the main infobox template, at the top or side of the page. However, if you really want it to be at the bottom, I would recommend putting the query into its own template (makes the query easier to change, among other things), and then adding that template to the form - below the free text input. Yaron Koren (talk) 00:59, 16 May 2018 (UTC)

Multiple within Multiple?
I'm working on a form where it would be nice to have a nested multiple. I'm tracking membership of pieces of repertoire on certain lists. Those lists generally have sublists. An example: The Royal Conservatory of Music has specific pieces to select from. There are multiple grade levels. To complete grade 3, I would select from the grade 3 list. (I would do a new wiki page for each grade level.) But then, within each grade level there are sub-lists. You have to pick one piece from list A, one piece from List B, One piece from list C, etc...

I have 2 cargo tables/categories. One category is "repertoire", the other category is "lists". When editing the List form, I would like to be able to add the list section name, then select repertoire that is in that list. So, then within the sublist, for each piece of repertoire I would like to click an "add another" button. This I can do with the multiple parameter in the 'for template' tag.

But then, I would like to be able to click another "add another" button to start a new sublist. Does this make sense?

Asked another way. Let's say I'm using your project management example in the book, but wanted to add a field "tools" to the tasks template. I have a "tools" category and want to add pages from that category into this field. And if I needed multiple tools, I would like to click "add another" within the task template. So for each project, I can click the add another for new tasks, and within each task, I could click add another for tasks requiring multiple tools.

Sorry. Not a coder, so I'm struggling a little with the documentation. But I'm getting there.


 * Let me see if I understand the data structure right: a music school has a group of grade levels, a grade level has a group of "music piece lists" (what you refer to as "sublists"), and a music piece list holds a group of music pieces. Is that correct? If so, this doesn't seem so bad - assuming that a music piece is just defined by a single string (as opposed to, say, the name of the piece and the name of its composer, separately), then the "sublist" doesn't have to be implemented with a multiple-instance template - it can just be a single field holding all the pieces, I think ideally edited with the "tokens" input type. (A "sublist" might require two fields in all - one for its name ("A", "B", etc.) and one for the list of pieces.) And since each grade level will have its own wiki page, you only need one multiple-instance template within the whole implementation. Does that make sense? Did I understand it correctly? Yaron Koren (talk) 03:00, 17 May 2018 (UTC)


 * Sort of. The list is a published list that thousands of piano teachers use as a progressive curriculum of study.  There are many such lists for various events and competitions a piano student might want to enter. Normally, you select 1 or 2 pieces from a list of 30-40 pieces.  In the end, I want users to be able to query the site for a piano piece that meet certain criteria.  Like I want a piece in G Major, Difficulty 4-5, on the Federation American Repertoire list.  Or I want a piece that is on both the Royal Conservatory of Music list Grade 4 AND on the Iowa Music Teachers list C.  I have a "repertoire" category (music pieces) that links to a "composer" category.  The "List" category will links to the "repertoire" category.  Some of these lists have sublists, like the RCM example above.  It would be useful to query membership on one of those sublists and also just to query based on the main list, if that makes sense. So I could look for a piece by a specific composer that is on the 4C list, or look for a piece that is on the 4A, 4B, or 4C list.  In my excel oriented mind, I'd have one column for the "grade" level, one column for the sublist, and one column to reference the repertoire. So for the Lists table, if I'm understanding correctly, the page name becomes the grade-level list, then I'd need a fied for the sublist and one for the repertoire. TO be user friendly to input, I would enter the sublist(A) once, then for the repertoire field, click "add another" until all the repertoire pieces are added.  Then click a different "Add another" for the Sublist (B) field, and again add all the repertoire. The other option would be to have the sublist re-entered each time, and just click add another until the complete list is done. Thanks for you help! May214 13:50 UTC, May 17, 2018


 * It seems like we're on the same page, more or less. However, I think your storage structure needs to be slightly bigger than what you're describing. I think you need five templates, with each one defining its own Cargo table, for each of the following: school, grade (of one school), list, piece, composer. Then, all but "list" should be on its own page, and should thus have an associated form; "list" will be a multiple-instance template in "grade" pages, and will thus be part of the "grade" form. And I think you should have the same data structure for each school, regardless of whether they have multiple lists for each grade. In other words, you shouldn't have lists and sublists - rather, each grade should have one or more lists, and if it has just one, that's fine. That unified approach will make both storage and querying much easier. Yaron Koren (talk) 16:21, 17 May 2018 (UTC)

Add Category Tag to Page Created in a Form
Imagine categories Book and Authors. The Book form has a filed to enter the author(s) from the category Authors. If the Author page already exists, I can use the values from category parameter to autocomplete. Great, Fantastic.

But, if I'm adding a Book page with a Form, and the Author Page doesn't already exist, I enter the Authors name, and the redlink is created that can be clicked and edited. BUT, I can't just click on the red-link then "edit with form" because that page does not yet belong to the category "Authors". Is there a way to add that category tag for new page titles entered in the Book form?

Doing a little more fishing in the archives, there was a similar questions about pointing red links to correct form, but it was for Semantic pages. Is there a simple parameter to point a red link to the correct form? May214 19:35, 17 May 2018 (UTC).


 * You don't need to add the nonexistent page to a category, thankfully. Instead, you should use #formredlink (in conjunction with #arraymap if it's a list of values) to display all the links - see here for how to do it. Yaron Koren (talk) 23:49, 17 May 2018 (UTC)


 * I'm struggling with the documentation. Part of the problem is I'm not completely familiar with MediaWiki, though your book is helping. What would be most helpful would be to see the actual template where the #formredlink is used.  I'm going to play around at the Discourse site that you link to and see what I can figure out from the templates there.


 * And as a newby, what is the template to call for signing a talk page that adds your user and time stamp?  May 214 17:13, 18 May 2018 (UTC)


 * Later that day... Got it.  Looking at the discourse template did the trick.  May214


 * And even later that day. Will the formredlinks show up on a list of pages? If people enter several items that don't yet exist, is there a way to find those redlinks?  They don't appear to show up in the Special pages: wanted pages list.  same guy


 * I never thought to check Special:WantedPages. It does indeed look like red links displayed by #formredlink don't show up on that page, which is unfortunate. I don't know if there's a way to fix it. However, it looks like if such pages are contained in results of Cargo or Semantic MediaWiki queries that are displayed on some page, they'll show up in Special:WantedPages due to that. Yaron Koren (talk) 20:40, 20 May 2018 (UTC)

Dropdown and combobox field do not like comma in article names
Hello. I'm using Mediawiki 1.30.0 with the page forms extension 4.3.1 on a Synology NAS. This system is not public. Cargo or Semantic Mediawiki is not installed. The PHP version is 5.6.34 and MariaDB 10.0.32 serves as database.

I created a form using the combox field:. If I create a new article I am able to choose one of the articles in the Bild category. After saving this new article all is fine. But if the choosen article in the Test field contains a comma in its name and if I want to edit that just created new article by using the form I get the following error in bold red letters:. This does not happen if the choosen article in the Test field contains no comma.

As alternative I changed the form using the dropdown field:. If I create a new article I am also able to choose one of the articles in the Bild category. After saving this new article all is fine, too. But if the choosen article in the Test field contains a comma in its name and if I want to edit that just created new article by using the form I get a blank field. The before choosen value has vanished, though, I am able to choose one of the articles in the Bild category again. This also does not happen if the choosen article in the Test field contains no comma.

Maybe I have to settle for article names without commas. But since the comma is not a very unusual symbol, it would be very uncomfortable.

Many thanks for some advice in advance! --Wgkderdicke (talk) 18:24, 19 May 2018 (UTC)


 * Sorry about that - this is a fairly recent bug that I thought I fixed a few weeks ago, but clearly not. I just checked in another attempt at a fix for it - please let me know if that worked. Yaron Koren (talk) 22:59, 20 May 2018 (UTC)


 * Thanks for the quick response. Your "another attempt" does the trick now. In both field types the "comma infected" article name now pops up when editing an existing article by using its form.--Wgkderdicke (talk) 16:36, 21 May 2018 (UTC)


 * That's great! Yaron Koren (talk) 00:17, 22 May 2018 (UTC)

The datepicker year dropdown field is somewhat limited
Hello again. This issue happens in the same environment as the dropdown/combobox issue.

Now I created a form using the datepicker field:. If I create a new article I am able to open the datepicker dialog. So far, so good. By click on the year dropdown button it presents me a list of years from 2008 to 2028, means +/- 10 years from now. In this range a selection is very comfortable. If I want to choose the year 1950, for example, I am not able to scroll until this year is shown in the dropdown list. But the list is not limited. By click on the first year of the list, 2008, the list reorganizes itself. After that click the list lasts from 1998 to 2018 now. You may imagine, what happens by clicking the 1998 and how long it takes until I reached the wanted 1950. OK, I can type the wanted date directly into the input field, but for what one needs this nice datepicker dialog then...

I did some trials with the first and last date option without success. I also added a line for the yearRange option in the PF_datepicker.js file with even lesser success. The button to open the datepicker dialog was missing then by using the form to create/edit an article.

Once more many thanks for an illuminating answer in advance! --Wgkderdicke (talk) 01:50, 22 May 2018 (UTC)


 * Well, the "datepicker" input type is best suited for picking dates around the current date - if you use a datepicker in, say, a flight or hotel website, you usually have to go forward or back one month at a time. I would recommend using the "date" input type instead, for dates that can be well in the past or future. Yaron Koren (talk) 02:59, 22 May 2018 (UTC)


 * OK, even if the datepicker dialog would provide regular scrolling, it would be not very convenient to scroll from now to 1950 or several hundred years back to pick a birthday from one of the old classical composers. From this point of view the date input seems to be better - you also don't have to bother with the date syntax but you don't have to scroll half around the world. Thanks for your tip. --Wgkderdicke (talk) 22:31, 22 May 2018 (UTC)

Show on select and listbox
Hello,In my wiki (MW 1.30 & PF 4.3.1),  does not work with   fields. It works however with  yet.Megajoule (talk) 21:16, 22 May 2018 (UTC)


 * Sorry about that! Apparently no one encountered this bug in the around year and a half that it has existed. I just checked in what I think is a fix for it. Yaron Koren (talk) 13:47, 23 May 2018 (UTC)

Rating input type
Hello again, The  input type doesn't seem to work : nothing is saved in the page regardless of the number of stars you select. Megajoule (talk) 21:46, 22 May 2018 (UTC)


 * I can't reproduce this - the "rating" input type works fine for me. This isn't on a public wiki by any chance, is it? Yaron Koren (talk) 01:37, 23 May 2018 (UTC)

HTML attribute value can not contain a list of values error
When trying to edit an existing page through the form page, I get this error: HTML attribute value can not contain a list of values.

Setup: I have autocomplete on category in my forminput parser. When I select one of the autocomplete options then click create or edit, I get the error. But, if I navigate directly to the page and click on edit with form, no such issue. May214 (talk) 21:37, 23 May 2018 (UTC)


 * This sounds very similar to an issue posted above, which was fixed - try upgrading to the very latest Page Forms code, if you're not using it already. Yaron Koren (talk) 15:47, 24 May 2018 (UTC)


 * Updated and issue persists. Here's my guess. This URL has the issue:


 * http://www.pianopedawiki.org/Special:FormEdit/Repertoire_Long/Bach,_C.P.E.,_Minuet_in_Eb_Major,_H_171.


 * I'm using commas in my page naming scheme. Is that throwing off the Special:FormEdit call? May214 (talk) 17:44, 24 May 2018 (UTC)


 * Later that day... Don't think it's the commas. Tried changing my page naming scheme without commas. Now I can't even save a new page using the form. It gives me the same "HTML attribute value can not contain a list of values". May214 (talk) 20:35, 24 May 2018 (UTC)


 * Are you sure you're using the very latest code? It doesn't look like you installed Page Forms using Git. Do you have this change reflected in your code? Yaron Koren (talk) 21:00, 24 May 2018 (UTC)


 * After Yarons note on his "another attempt at a fix" of that bug I downloaded the extension from this link. It's the Download Git master link in the infobox of the extension's main page. The error is gone, but the version number remained the same.--Wgkderdicke (talk) 00:11, 25 May 2018 (UTC)


 * Boom Winning. Thanks Yaron and Wgkderdicke. Looks like learning git is next on my queue. May214 (talk) 15:44, 25 May 2018 (UTC)