Jump to content

Extension talk:Page Forms/Archive April to June 2022

From mediawiki.org

[RESOLVED] No display of a jqplotchart query called from a form

MW 1.35.6 / PHP 7.4.27 / MariaDB 10.1.48 / SMW 3.2.3 / PF 5.3.4

My SearchPeople query form calls the SearchPeople template which contains the following query (which I have simplified for testing): {{#ask:[[Category:People]]|?unit|mainlabel=-|format=jqplotchart|distribution=1|charttype=pie}}

The request does not succeed (a spinning logo rotates indefinitely) when I go through the form that I also simplified for testing: {{{for template|searchPeople}}}{{end template}}

Yet the template page does display the graphic.

In a previous version of my MediaWiki system (MW 1.31, SMW 2.5.8, PF 4.3.1), this works (with exactly the same code and more complex form/template duos).

PS1: To see if this changed anything, I switched the type of the form button from GET to POST by changing line 149 in PF_RunQuery.php. Nothing changed.

PS2: Since the upgrade to PF 5.3.4, I also get this type of warning: Notice: Uninitialized string offset: 37 in /var/www/mediawiki/extensions/PageForms/includes/PF_FormPrinter.php on line 1009

I can add the bug in Phabricator if necessary. Megajoule (talk) 11:09, 1 April 2022 (UTC)

Do you see any JavaScript errors, if you look in the browser console? To see a clear error message, you may need to add "&debug=true" to the URL. Yaron Koren (talk) 13:12, 1 April 2022 (UTC)
In the meantime, I'm debugging the upgrade from SMW 3.2.3 to SMW 4.0.1. which messes up my wiki by blocking all javascript.
I've just noticed that the jqplotchart problem and the problems related to the migration to SMW 4.0.1 are naturally solved when I remove the display errors:
# ini_set( 'display_errors', 1 );
Does this little # allow SMW 4.0.1 to work and thus the query form leading to a jqplot ask to succeed? I don't know and I don't care (yet). Thank you in any case Yaron for forcing me to go deeper into the debugging. --Megajoule (talk) 21:58, 1 April 2022 (UTC)

editor=wikieditor in a field crashes the form

MW 1.37.2 / PHP 7.4.27 / SMW 4.0.1 / PF 5.3.4

Specifying editor=wikieditor in a textarea field causes the form to crash when trying to create a new page with that form. This is the error message for a form called MyForm:

WikiPage constructed on a Title that cannot exist as a page: Spécial:AddData/MyForm

The form does not crash when modifying a previously created instance.

The problem was not seen with MW1.35.4 and SMW3.2.3

Megajoule (talk) 21:02, 2 April 2022 (UTC)

I'm using the same version of MW and PageForms. But I'm not able to see this error while creating a page. Techwizzie (talk) 02:55, 17 April 2022 (UTC)

Embedding query forms broken

All of a sudden embedding query forms does not work any longer "

{{Special:RunQuery/PageQueryKeyword}}

leads to

Special:RunQuery?pfRunQueryFormName=PageQueryKeyword&PageQueryKeyword[keyword][]=foo+bar&PageQueryKeyword[keyword][is_list]=1&wpRunQuery=&pf_free_text=

The error I am now getting: "You must specify a form name in the URL; the URL should look like "Special:RunQuery/<form name>".


The form looks like this:

<includeonly>{{{info|query title=Query for pages with the given keyword:}}}
{{{for template|PageQueryKeyword}}}
{{{field|keyword|input type=tokens|values from property=Has keyword|max values=1}}}
{{{standard input|run query|label=Start search}}}
{{{end template}}}</includeonly>

Last time I used this about 4 weeks ago it was still working. In the meantime nothing was updated for the wiki, i.e. it is on MW 1.31.16 and PF 5.0.1. Now updating to PF 5.2.1 did not help. Any suggestions that may help to find out why it is no longer working. 2003:F1:C725:6300:4094:E81D:9963:3FBA 08:34, 12 April 2022 (UTC)

Embedding a query form actually works fine for me. It's strange that your URL has Special:RunQuery as (I assume) the name of the page, and not the actual page that the form is embedded in. Why is that, do you know? Yaron Koren (talk) 18:38, 18 April 2022 (UTC)
Yes the URL is as posted and not containing the name of the originating page. Since the error message claims that Special:RunQuery should be part of the URL it did not realize that this could be the issue. Still, worked before and not sure why this happens all of a sudden. Now using queryformlink to provide the search though not as nice. --Marbot (talk) 07:30, 20 April 2022 (UTC)

Preload field in free text not working with {{#autoedit:...

On Page Forms master

Product Version
MediaWiki 1.35.5
PHP 7.4.22 (cgi-fcgi)
MariaDB 10.4.11-MariaDB
ICU 66.1
Lua 5.1.4

You can preload data for the free text input which works fine when used with {{#formlink:.... but it does not seem to work with the {{#autoedit:... parserfunction.

I tried to figure out what is going wrong but the below simple Form works fine when used with the formlink parserfunction but when used with the autoedit parserfunction the content of the Load autofill page is ignored and does not end up on the created page.

<includeonly>{{{info|query form at top|onlyinclude free text}}}{{{for template|Aaaa}}}

* {{{field|Equipment}}}

 {{{end template}}}

{{{standard input|free text|input type=textarea|editor=wikieditor|rows=25|preload=Load autofill}}}</includeonly>

I am not sure if this is on purpose or if there is something wrong. We only used preload for template parameters until now but we want to be able to preload the free text on a page. Thanks and regards, Felipe (talk) 12:40, 12 April 2022 (UTC)

I believe it's on purpose, although maybe it's not ideal; parameters like "preload=" and "default=" only apply when creating a new page, not when editing an existing page, and I think that holds true even when using #autoedit. If that's true, then there may be no way to modify the free text from within #autoedit, although there probably should be. Yaron Koren (talk) 18:33, 18 April 2022 (UTC)
Hello Yaron, the above applies when generating a new page not an existing one with formlink or autoedit. I understand and agree (we had that discussion in the past) that it does not apply for editing existing pages. To me it seems that autoedit is not "aware" or ignores the standard input|free text field in the form when it automatically generates the new page. It only "looks" in-between the {{{for template|.... and {{{end template}}} calls. Felipe (talk) 11:18, 21 April 2022 (UTC)

Table Error in textarea field

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

I am getting the above error. My fields are set for textarea.

Not sure if cargo field matters but it is wikitext.

I am using PageForms 5.3.4 and mediawiki 1.35 Thanks, Margaret Issiegainsley (talk) 13:58, 16 April 2022 (UTC)

The pipes are used within the template to separate the parameters with their values. Any table added to the parameter like you describe would "break" the template. You can still add tables to to a parameter but you need to replace all the pipes "|" used in the table with the magic word {{!}} . See: Help:Magic_words#Other.
{{{!}} class = "wikitable" width = " 30%"
! Header 1
! Header 2
! Header 3
{{!}}-
{{!}} Some text
{{!}} align = "center {{!}} Some more text
{{!}} align = "right {{!}} And even more
{{!}}}

Would result in:

Header 1 Header 2 Header 3
Some text Some more text And even more
Felipe (talk) 08:33, 18 April 2022 (UTC)

The combobox fields are not user-friendly

When a value has been previously entered in a combobox field, the list of other possible values is not displayed.

To change the value, the user must delete the old value with the Delete or Backspace keys. The user may then have the impression that it is impossible to change the value.

Megajoule (talk) 08:35, 17 April 2022 (UTC)

Mandatory parameter does not work in combobox

With the last version of Page Forms 5.3.4, the mandatory condition does not apply if input type=combobox. The warning message does not appear and the user can save the form even if the field is blank. An example here. Manu.wikidebats (talk) 18:57, 18 April 2022 (UTC)

This was fixed here. Yaron Koren (talk) 17:15, 21 April 2022 (UTC)
Thanks! It works. Manu.wikidebats (talk) 21:54, 21 April 2022 (UTC)
Is it possible, that it's the same with unique? RacingRalf (talk)

Any suggestion to troubleshoot 'autocomplete on URL'?

Hi - I believe I followed all the steps described at this page to set up an external source for autocomplete. I can go to the URL and look up a value manually and the page returns a JSON object that matches what is described in the documentation. Once I am in the form, I am not getting any value using the mapping I defined in LocalSettings. Do you have tips to debug what is going on? I am not seeing any error in the browser console or in the form itself. Lalquier (talk) 20:17, 20 April 2022 (UTC)

One thought about it - does Page Form expect a particular Mime Type or header for the JSON content produced by the remote URL? Another possibility is an interference with a single sign on extension we are using. In any case, a way to have some kind of trace or log of what Page Form is doing with autocomplete would be helpful. Lalquier (talk) 22:43, 20 April 2022 (UTC)

Property parameter does not work for combobox

With the last version of Page Forms 5.3.4, property (or values from property) parameter does not work if input type=combobox. No autocompletion applies (but it does for values from category). An example here. Manu.wikidebats (talk) 21:59, 21 April 2022 (UTC)

Looks like property values ​​don't like property names with an apostrophe. I took the liberty of doing a test on your wiki with a property with a "more suitable" name (Property:TestAttribut) and it worked. I advise you to rename your attributes and retest. Megajoule (talk) 08:03, 23 April 2022 (UTC)
Thanks! Now the titles are displaying... but if they are long, the end of the title is of this kind: A la différence des ordres d'exécution pfe27252df55cf9ac6e3d1f5d512ec765.
So, it's still not working :(. Manu.wikidebats (talk) 17:17, 24 April 2022 (UTC)
Now it's working. I had to change the property declaration: [[Has type::Text]] to [[Has type::Page]].
But why? This property does not refer to pages but to text. Manu.wikidebats (talk) 17:32, 24 April 2022 (UTC)
Again, I took the liberty of testing on your wiki by changing the type of the page attribute to text (I reset page after my tests...). Indeed, when the value exceeds 72 characters, cryptic characters are displayed after the 40th character. A quick search of the SMW docs shows that there are indeed differences in the treatment of Text and Page types.
Can you modify the $smwgFieldTypeFeatures parameter to see if the SMW_FIELDT_CHAR_LONG setting fixes the problem? --Megajoule (talk) 11:27, 27 April 2022 (UTC)
It works! Thanks so much! Manu.wikidebats (talk) 13:21, 30 October 2022 (UTC)

A concrete example of the use of the promising "values dependent on" functionality?

I feel like I'm digging up an old topic but I haven't found a clear answer to this question in the documentation of the Page Forms extension or in the talk archive.

Is there an example of the implementation of the "values dependent on" feature somewhere on the web? My tests didn't give me much and despite what the documentation says, the example given (restaurant, country, city) doesn't shed any light on how this parameter works.

My hidden hope is that this will overcome the current malfunction of the Semantic Forms Select extension. Megajoule (talk) 07:11, 28 April 2022 (UTC)

You can see an example here, using this form - the values for "Position" are dependent on the value for "Topic". Thankfully you can modify these values even when logged out. Yaron Koren (talk) 13:58, 28 April 2022 (UTC)
OK. Thank you for this example. I have the same type of code except that the form is not multiple and I am not using Cargo but SMW. I have a class instance that registers the City and Country properties. However the choice of country in the form does not show the city...

Template:Restaurant

* Country: [[Country::{{{Country|}}}]]
* City : [[City::{{{City|}}}]]

Form:Restaurant

{{{info|page name=Test Values dependent on}}}
{{{for template|Restaurant}}}
{{{field|Country|property=Country|input type=combobox}}}
{{{field|City|property=City|input type=combobox|values dependent on=Restaurant[Country]}}}
{{{end template}}}

Property:City and Property:Country

[[Has type::Text]]

La Tour d'Argent

{{Restaurant
|Country=France
|City=Paris
}}

Megajoule (talk) 07:17, 29 April 2022 (UTC)

There may be a bug with the handling of "values dependent on" in SMW - it's been a long time since I tested it. Yaron Koren (talk) 13:14, 29 April 2022 (UTC)

_run table display bug

Adding _run onto a query string results in an odd display bug with tables. To reproduce:

  1. Click this link
  2. Now click "run query" on the same page, and the table difference will be obvious. Frybread (talk) 04:48, 29 April 2022 (UTC)

Combobox - A non-numeric value encountered

I'm not sure if this is an error with my form or an error with PageForms, any ideas on how to remedy (other than not using Comboboxes)?
MediaWiki - 1.35.6
PHP - 7.4.25 (cgi-fcgi)
MySQL - 8.0.28-0ubuntu0.20.04.3
PageForms 5.4

ErrorException from line 99 of /home/username/website.com/w/extensions/PageForms/includes/forminputs/PF_ComboBoxInput.php: PHP Warning: A non-numeric value encountered

  1. 0 /home/username/website.com/w/extensions/PageForms/includes/forminputs/PF_ComboBoxInput.php(99): MWExceptionHandler::handleError(integer, string, string, integer, array)
  2. 1 /home/username/website.com/w/extensions/PageForms/includes/forminputs/PF_ComboBoxInput.php(196): PFComboBoxInput::getHTML(string, string, boolean, boolean, array)
  3. 2 /home/username/website.com/w/extensions/PageForms/includes/PF_FormPrinter.php(2042): PFComboBoxInput->getHtmlText()
  4. 3 /home/username/website.com/w/extensions/PageForms/includes/PF_FormPrinter.php(1408): PFFormPrinter->formFieldHTML(PFFormField, string)
  5. 4 /home/username/website.com/w/includes/StubObject.php(116): PFFormPrinter->formHTML(string, boolean, boolean, integer, string, string, NULL, boolean, boolean, boolean, array, User)
  6. 5 /home/username/website.com/w/includes/StubObject.php(142): StubObject->_call(string, array)
  7. 6 /home/username/website.com/w/extensions/PageForms/includes/PF_AutoeditAPI.php(978): StubObject->__call(string, array)
  8. 7 /home/username/website.com/w/extensions/PageForms/includes/PF_AutoeditAPI.php(129): PFAutoeditAPI->doAction()
  9. 8 /home/username/website.com/w/extensions/PageForms/specials/PF_FormEdit.php(103): PFAutoeditAPI->execute()
  10. 9 /home/username/website.com/w/extensions/PageForms/specials/PF_FormEdit.php(44): PFFormEdit->printForm(string, string, NULL)
  11. 10 /home/username/website.com/w/includes/specialpage/SpecialPage.php(600): PFFormEdit->execute(string)
  12. 11 /home/username/website.com/w/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(string)
  13. 12 /home/username/website.com/w/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
  14. 13 /home/username/website.com/w/includes/MediaWiki.php(945): MediaWiki->performRequest()
  15. 14 /home/username/website.com/w/includes/MediaWiki.php(548): MediaWiki->main()
  16. 15 /home/username/website.com/w/index.php(53): MediaWiki->run()
  17. 16 /home/username/website.com/w/index.php(46): wfIndexMain()
  18. 17 {main}

TiltedCerebellum (talk) 05:10, 12 May 2022 (UTC)

I figured it out, apparently size must be set to some numeric value, but nowhere is that stated in the docs, nor does it fail gracefully, warn, or have a default. Imo there should be a default to prevent exceptions, or at the very least a warning on save. At some point we had a user change or delete the value, and it kicked this error TiltedCerebellum (talk) 05:20, 12 May 2022 (UTC)
"size" doesn't have to be set, although it did lead to a PHP warning if it was set to a non-numeric value (like "50px" instead of "50"). I just checked in a fix for this. Yaron Koren (talk) 13:56, 12 May 2022 (UTC)

I am creating a card game wiki and would like to have the queryformlink button text show card suit symbols (Spades/♠, Hearts/♥, Diamonds/♦, Clubs/♣).

I have tried to use Unicode and HTML-codes for these symbols and also a link to an image. None of these seem to work. (PageForms 5.4, MW 1.35.2). Also I do not see any card suit icons in the OOUI set which would be an option I could live with (assuming I can figure out how to change the button icon from '> next').

Pre OOUI usage this was possible (ie. I can do this in PageForms 4.6).

Am I missing something fundamental that would allow me to have this more user friendly interface?

Thanks in advance, Gregg GMShimokura (talk) 02:35, 13 May 2022 (UTC)

That's too bad. I haven't tried this personally, but I can think of two potential approaches: (1) having the links be of the default text type, instead of buttons, and using CSS to make them look more like buttons; or (2) adding some JavaScript (in MediaWiki:Common.js) to change the text on the buttons, after they have already been rendered. Yaron Koren (talk) 03:06, 13 May 2022 (UTC)

Datetimepicker (and combobox), highly criticized by users

I get very negative feedback from my users about the datetimepicker fields. They say that these fields are not at all ergonomic compared to the old version, especially :

  • it is impossible to enter a whole date with the keyboard (e.g. 21/02/2022 17:04)
  • the current date and time is filled in by default when you start filling in the field (including minutes and seconds!), which means that you have to update everything (including minutes and seconds, which the user often has to reset to 00).
  • the delete button on the right of the field is not explicit. Moreover, on the Linux version of Firefox, its width is reduced to a few pixels (you have to aim right).

If we also consider combobox, it is difficult to find advantages to the change to OOUI.

Will a white knight fight this dragon? Megajoule (talk) 13:59, 22 May 2022 (UTC)

I admit that the datetimepicker input has some problems (I didn't know about Firefox on Linux). I should note that there's also a "datetime" input type - which is not JavaScript-based, but it might appeal more to your users. What are the problems with "combobox"? Yaron Koren (talk) 14:16, 22 May 2022 (UTC)
Hello Yoren,
Thank you for your answer. The datetime type is even less ergonomic (no navigation in a calendar + a field for day, month, year, hour, minutes, seconds, PM/AM... phew!).
In a form, a user should be able to move from field to field with the TAB key and type an entry with the keyboard if he wants. And for the date/time fields, he must be able to fill it in at once.
For combobox, I noted:
Megajoule (talk) 16:02, 22 May 2022 (UTC)
Okay, thanks for putting all of these in one place. Were any/all of these working when combobox was defined with jQuery UI instead of OOUI, do you know? Yaron Koren (talk) 17:48, 22 May 2022 (UTC)
I just tested on a jquery version :
  • The geocoding with leaflet was not working so impossible to know if feeds to map worked with combobox fields
  • The other possible values are displayed when a value has been previously filled in.
  • As for OOUI, image preview does not work: at the creation of the page, no preview at all. On modification, the image previously filled in is displayed but the display is not updated if you change the file in the combobox. Megajoule (talk) 18:09, 22 May 2022 (UTC)

visualeditor in fields not working

Hi,
MW 1.35.6 | SMW 4.0.1 | Foreground 2.4.0 | PageForms 5.1 | VEForAll 0.4 | VisualEditor 0.1.2
I have in my form fields that I want to be used with VEForAll to have a VisualEditor bundled in it. I used |editor=visualeditor before, but since the upgrade from 1.35.2 to 1.35.6 it broke and now the field is simply greyed out and disabled. Thus, I've to put it back to a normal text field to make it usable. Could you please help me make the form working again? Here's the configuration I have for PageForms:

$wgPageFormsLinkAllRedLinksToForms = true;
$wgPageFormsHeightForMinimizingInstances = -1;

Raphoraph (talk) 18:50, 11 June 2022 (UTC)

Okay, so tested with the Vector skin, and suddenly it worked… not only with Vector but with Foreground too. I'm a little confused. Perhaps without noticing, I cleared some cache or data, and it worked. Raphoraph (talk) 19:13, 11 June 2022 (UTC)

pf_autoedit_fail error

Switching from PF 5.21 to 5.3x, the message "Modifying <a href="pagetitle..."> failed." appears in case of an anonymous edit. It's impossible to edit a page with PF when non-logged. An autoedit error appears. Yet the #autoedit function is not used in the form.

An example here. (Note the captcha: "Wikipedia" or "debats".) Manu.wikidebats (talk) 16:03, 21 June 2022 (UTC)

How to display form uploaded image in completed page?

I was able to create a form that requires multiple inputs and allow a file upload.

Once done/saved, the new page does not display or reference the uploaded file. I have also tried adjusting the field to the file reference [[File:xxxx.png|frameless|1000px]] as is the formatting I am planning to use but no images display. Coreyjohnson75 (talk) 17:06, 24 June 2022 (UTC)

Was the file uploaded, and is its name stored in the template call on the page? If so, the problem is somewhere in the template. Yaron Koren (talk) 17:48, 24 June 2022 (UTC)
It uploads the file but the upload pop-up window goes white/blank after the upload. I can see the file under file list. If I close the pop-up the file name is not visible on the form. Coreyjohnson75 (talk) 18:58, 24 June 2022 (UTC)
I'm guessing there's some kind of JavaScript error. Can you try it again, this time looking in the browser console (if you know how to do that) to see if an error occurs? Yaron Koren (talk) 14:00, 1 July 2022 (UTC)
I tried again and had the same results. Found this in the console from Dev Tools:
ReferenceError
Coreyjohnson75 (talk) 15:14, 1 July 2022 (UTC)

Remote Autocompletion values arriving differently than Local when using values from property=xx when xx Has type::Keyword

Hi. I wanted to list a weird thing that has started happening to me recently (since January 2022) with Keyword properties. When Page Forms pulls the list of items from a keyword property for local autocomplete, they show up as they were entered.. capitalization and everything (even though internally there isn't case sensitivity to them I know)... but when it switches to remote autocompletion, suddenly everything is all lowercase. I have figured the best way to solve this is just never touch the keyword type for now, but if it were possible to keep capitalization for looks purposes and have the smw search be case insensitive (which I think was my original thought of using keyword and how it seemed to work a while ago), it'd be even better.

RinaCY (talk) 20:09, 30 June 2022 (UTC)

I had never heard of the "Keyword" type before, but I just looked up its documentation page, and it does say that Keyword values are "normalized (lowercased, removed diacritics)". So it sounds like it's local autocompletion that's doing it "wrong". Though really, maybe you should always be entering these values as all-lowercase? Yaron Koren (talk) 14:05, 1 July 2022 (UTC)
You're likely right, I guess I just noticed how it worked at one point then once things got too large it completely changed, and now things have to be rewritten. RinaCY (talk) 17:42, 6 July 2022 (UTC)