Page MenuHomePhabricator

Unable to use empty string as parameter (Required for continue=)
Closed, ResolvedPublic

Description

We need an ability to pass an empty string parameter, such as api.php?continue=&... -- this is especially critical with the new "continue" param that enables the simplified continue mode (empty string), or will be used in the subsequent api calls as a regular string returned from previous call.

Implementation proposal:

Every string parameter should have a checkbox in front of the text field (to allign with the boolean parameters).

  • User can set the checkbox to mean "send an empty string as value"
  • Starting to type in the text field should automatically set the checkbox.
  • Deleting text in the field would clear the checkbox.
  • Clearing the checkbox should delete all text.

Version: unspecified
Severity: normal

Details

Reference
bz45811

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:24 AM
bzimport set Reference to bz45811.
bzimport added a subscriber: Unknown Object (MLST).

Why is the magic value "" instead of something like "start"? To save bytes?

(In reply to comment #1)

Why is the magic value "" instead of something like "start"? To save bytes?

:) No, but I didn't think the sandbox would not let me pass in an empty string value as a parameter. Also, there could be other modules that I am not aware of that may allow empty string parameters. That's why i think apisandbox should be able to handle such cases. This was also anomie's opinion when discussed on IRC.

There was a number of other ideas - always return the "continue" element in addition to "query-continue" in the result, unless there was a "continue" parameter. Or add a "string|bool" api parameter type, and let apisandbox handle that as described above, while keeping all other strings as non-empty.

Change 209570 had a related patch set uploaded (by Anomie):
WIP: Add Special:ApiSandbox

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

Change 209570 merged by jenkins-bot:
Add Special:ApiSandbox

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