https://bugzilla.wikimedia.org/show_bug.cgi?id=45652

Brad Jorsch <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |easy
                 CC|                            |[email protected]

--- Comment #1 from Brad Jorsch <[email protected]> ---
Looking at the code, it seems to me that the default will always be printed as
long as it's not null or false. But many parameters use null as the default,
either because there is no sane default or because the default is to skip the
relevant bit entirely, which often results in the behavior of either "all" or
"none"; for example, for many namespace parameters the null default is
equivalent to something like
0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|100|101|108|109|710|711|446|447|828|829
(depending on the specific namespaces available on each wiki), but actually
specifying that as the default would change the "where" portion of the SQL
query from something like "WHERE pl_from IN (...)" to something like "WHERE
pl_from IN (...) AND pl_namespace IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 100, 101, 108, 109, 710, 711, 446, 447, 828, 829)".

Note that for boolean parameters the default is always false, and trying to set
anything other than null or false as the default results in an error for all
queries. From the client, specifying the parameter at all, even as
"&redirect=no", "&redirect=false", "&redirect=0", "&redirect=", or (in GET
requests) "&redirect", is interpreted as true in line with the behavior of
checkboxes in HTML forms.


The indication of type should be relatively easy for someone to pick up; it
should probably go somewhere in the makeHelpMsgParameters() method in
includes/api/ApiBase.php.

Cleanup of any modules that use null for the default and take behavior
equivalent to something that could be specified as a default should also be
relatively easy, if tedious.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to