Extension talk:Page Forms

Auto-fill multi-instance template from previous one
Is this possible? I have in mind a tick box like you often see on a shopping website alongside "Shipping address is same as billing address".

The idea is that the subsequent ones would be mostly the same, so it would be easier to change one or two things than type several. Jonathan3 (talk) 22:30, 13 April 2023 (UTC)


 * There's no easy way to do that, but what you can do instead is have it say something like "Leave the shipping address blank to use the billing address for shipping" - and then have the template handle it. Yaron Koren (talk) 03:04, 14 April 2023 (UTC)
 * Thanks. What are the difficult ways? Jonathan3 (talk) 08:55, 14 April 2023 (UTC)
 * Using a PHP or JavaScript hook to add custom code. Yaron Koren (talk) 16:46, 14 April 2023 (UTC)

Combobox Autocomplete Not Finding Results
Per the documentation, I have a table that contains many items with accents, special characters, etc that also has 800+ items in it (hooray video game inventories). So I'm thus required to use a combobox if I want to enable users to select items from that Cargo table as entries.

This is my code:

I've also tried adding "with autocomplete" to the combobox but that does not work.


 * I've rebuilt the Cargo table.
 * I've tried pointing it to other Cargo tables on my site that are much smaller by changing cargo table/cargo field--this works fine.
 * I've pasted literal entries that I've copied from the Cargo admin view showing me entries in the table--No matches.
 * All I ever get is "Please enter 1 or more characters." Even if I type something (instead of paste) that I know is in the table, I am told "No matches."

What have I missed? SovereignGFC (talk) 22:43, 17 April 2023 (UTC)


 * Does this also happen with items with ASCII names, i.e. no accents or other special characters? Yaron Koren (talk) 10:34, 19 April 2023 (UTC)
 * I have done a test with a small set of special character names:
 * Shakudō Chrysanthemum Pendant
 * Partagás Cigars (Perfectos Finos)
 * Médaille d'honneur (Vermeil)
 * Letter of Regard from İsmet İnönü
 * This works.
 * Unfortunately, that means there's something in a table that has over 800 rows that is causing a problem. I will try to narrow it down as I have imported the data in six different sections. SovereignGFC (talk) 00:11, 20 April 2023 (UTC)
 * Update 4/22/23...
 * Unfortunately I'm even more confused. I took one of the six chunks, found all entries with non-Latin characters (including ' which apparently counts), and imported that list on its own.  Those all worked fine.
 * I did the reverse, only Latin. This also worked.
 * But when I import the whole spreadsheet including both the Latin and non-Latin entries, I get "Please enter one or more characters" in the form drop-down.


 * Something's wrong with the import. When I import JUST the non-Latin from spreadsheet, then JUST the Latin-only (doing it in two parts), it works fine.
 * SovereignGFC (talk) 19:17, 22 April 2023 (UTC)
 * This is not necessarily a bug - the "Please enter one or more characters" message shows up when the input uses remote, instead of local autocompletion, which in turn happens when the number of total possible values for that input is above a certain number, by default 200. So that is probably what is happening when you import the entire spreadsheet. The issue is only what happens after you type in one or more characters. Is remote autocompletion not working at all, for any values? Yaron Koren (talk) 22:56, 23 April 2023 (UTC)
 * OK so I'm on my 101st item. Per the documentation, that causes remote autocompletion.
 * When I type the name of something I know is in there (or paste it from the table), nothing comes up. It simply says No Matches.
 * Do I need to check/modify settings on my server/in my installation since that number of items switches to treating my own server as "remote" autocompletion? SovereignGFC (talk) 02:08, 24 April 2023 (UTC)
 * Oh yeah, 100. Here is one way you can check: open the browser console, and go to the "Network" tab. (Hopefully there's one in whatever browser you are using.) Then type into the autocomplete input. Presumably every character you type will lead to a new API URL showing up under "Network". Go to any of these in a new tab or window - that will show what the API is returning. Yaron Koren (talk) 02:29, 24 April 2023 (UTC)
 * Got it.
 * So the final result is this once I've completed typing in the whole value.
 * Object { code: "internal_api_error_MWException", info: "[ZEaDDQb_wJ5pfNAW-Y93kQAAAow] Caught exception of type MWException", errorclass: "MWException" } SovereignGFC (talk) 13:28, 24 April 2023 (UTC)
 * Okay, now we're getting somewhere. Could you please add the line  to your LocalSettings.php file? That should make for a more helpful error message. Yaron Koren (talk) 13:51, 24 April 2023 (UTC)
 * Exception caught: Error: the string "`" cannot be used within #cargo_query.' SovereignGFC (talk) 20:45, 24 April 2023 (UTC)
 * Okay, that explains it. From March 8 to March 23, there was code in Cargo that disallowed that backtick string in queries. It was removed because it caused some problems, including with Page Forms autocompletion. If you update your Cargo code - or, for that matter, if you keep the existing Cargo code but update your Page Forms code - the problem should go away. Yaron Koren (talk) 14:13, 25 April 2023 (UTC)
 * Updating to version 5.6.1 resolved the problem. SovereignGFC (talk) 12:38, 26 April 2023 (UTC)
 * Great! I'm glad to hear that there was no problem with non-ASCII handling. Yaron Koren (talk) 13:46, 26 April 2023 (UTC)

Show on select only working once (first instance of ID)
Is the "Show on select" parameter only supposed to work one time on the page? I'm surprised by this. Unless we did something wrong on our setup. We have recently updated things but I thought it used to work for all instances of the ID specified.

Is there any way to make it work for more than one id at a time? For example

Section one for books. Section one for dissertations. Section one for tibetan. Section one for sanskrit. Section one for classical. Section one for issues.

Section two for books. Section two for dissertations. Section two for tibetan. Section two for sanskrit. Section two for classical. Section two for issues.

Section three for books. Section three for dissertations. Section three for tibetan. Section three for sanskrit. Section three for classical. Section three for issues.

Making it so it'll work on all three sections of elements here, and when Books is selected the three divs with id="books" are shown, all the others are hidden?

Thanks!

Jeremi Plazas (talk) 19:53, 20 April 2023 (UTC)


 * You can have something like, if that's what you're asking. Yaron Koren (talk) 13:45, 21 April 2023 (UTC)

Editing forms with Minerva Neue mobile version
I try to edit forms with Minerva Neue from a mobile and some troubles happen with JS -- for instance for tokens. An exemple here. I am using the last master branch and Mediawiki 1.39.

Is there a solution to fix it?

Thanks by advance! Manu.wikidebats (talk) 18:42, 28 April 2023 (UTC)

Problems with "Edit with form" tab and preview when using Page Forms
I'm having 2 problems with PageForms in MediaWiki version 1.39.

1. The "Edit with form" button does not appear on pages configured with Page Forms.

- I checked if there was any conflict between the extensions, but there wasn't.

- I cleared the cache.

- The settings are configured correctly.

I would like to know what it could be and how to solve it.

2. When I click to preview a page I'm creating using Page Forms, the preview doesn't work and I get the

following sentence: EditPage does not have a context title set

What could be causing this problem?

Thank you so much in advance! Sakura.tech (talk) 20:26, 28 April 2023 (UTC)


 * What do you mean by "configured with Page Forms"? And what version of Page Forms are you using? Yaron Koren (talk) 21:14, 28 April 2023 (UTC)
 * Hello Yaron
 * I mean by configured with Page Forms, the pages that were created using Page Forms
 * The version of Page Forms is 5.4 2804:14C:6581:5A74:5889:C932:D29F:4436 03:43, 29 April 2023 (UTC)
 * See here for how to get the "edit with form" tab to display. Yaron Koren (talk) 15:08, 1 May 2023 (UTC)
 * Thanks @Yaron Koren the tab is showing now. Regarding the second error, do you know what it could be? 2804:14C:6581:5A74:615F:5257:4FC7:E1BA 19:00, 5 May 2023 (UTC)
 * What is the full error message, including file and line number? Yaron Koren (talk) 20:44, 5 May 2023 (UTC)
 * File: EditPage.php, line number 566.
 * Full error message: "EditPage does not have a context title set"
 * I don't think it's an error in the code, maybe it could be a bug. When I click on preview to see the page I'm creating with PageForms it says "EditPage does not have a context title set" and I can't see the preview of the page 2804:14C:6581:5A74:615F:5257:4FC7:E1BA 21:10, 5 May 2023 (UTC)