Page MenuHomePhabricator

Let "form=" parameter for #forminput take in a comma-separated list
Closed, ResolvedPublic

Description

Right now, the #forminput parser function, defined in the Page Forms extension, can either take in a single value for "form=" - in which case the user gets sent to that form - or no value at all - in which case the user sees a dropdown with all the form names, and has to choose one. It would be great if "form=" could also take in a list of forms, separated by commas, and then the user would get a dropdown with just those form names in it.

Hint: the easiest way to do this might be to add an optional array parameter to PFUtils::formDropdownHTML().

Also, in forms that already have a comma in their name (it's very rare, but it can happen), the comma should be escaped, as in "\,", so that the code knows that it's not a delimiter.

Event Timeline

I have modified the renderFormInput() function in PF_ParserFunctions.php and
the formDropdownHTML() function in PF_Utils.php.
Which now gives the following result:

form-edit.png (903×1 px, 37 KB)

Is this the correct way to display a form name with an escaped comma ?

No - it should show up as a regular comma, like it does in the form name.

Also, please don't take any more microtasks, if you were thinking about taking more - I should have stated before that everyone should do no more than one.

Change 410237 had a related patch set uploaded (by Yashdeep97; owner: Yashdeep97):
[mediawiki/extensions/PageForms@master] forminput: Enable Comma Seperated List in #forminput parser function

https://gerrit.wikimedia.org/r/410237

Change 410453 had a related patch set uploaded (by Yashdeep97; owner: Yashdeep97):
[mediawiki/extensions/PageForms@master] forminput: Enable Comma-seperated List in #forminput parser function

https://gerrit.wikimedia.org/r/410453

Change 410453 abandoned by Yashdeep97:
forminput: Enable Comma-seperated List in #forminput parser function

https://gerrit.wikimedia.org/r/410453

Is the task abandonned or resolved? I would like to take it.

@BamLifa - someone else is already working on it.

Thank you! Aren't there any other micro tasks for GSoC that need owner?

Yes - the last three. I hope to add more, but these should be all doable - you can look into T187114, for instance; it's a medium task as opposed to a small one, but if you just do a few hours of work on it and send me a patch for what you have, I should be able to at least get a sense for your coding skills.

Thank you sir. I'll do something and push my patch to help you evaluate my coding skills.

Change 410237 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Enable Comma-seperated List in #forminput parser function

https://gerrit.wikimedia.org/r/410237