Commit graph

521 commits

Author SHA1 Message Date
jenkins-bot
3e29dd85ed Merge "doxygen: Changed Doxygen tags causing warnings during documentation generation" 2020-04-16 18:45:56 +00:00
Daimona Eaytoy
dbb23e3952 Upgrade phan to 0.10.2
Amongst other things, this version of phan bundles taint-check, which is
however disabled in the config file because there are lots of issues to
be fixed.

Upgrading phan alone now means that we can have a clean baseline for the taint-check upgrade.

Bug: T248630
Change-Id: I8ab7ef9a9e73952098664176aad6c2b3b88095ee
2020-04-16 00:28:13 +00:00
Holger Knust
471d2371ab doxygen: Changed Doxygen tags causing warnings during documentation generation
Updated Doxygen markup in several .php files triggering warnings when mwdocgen.php is executed. Removed
obsolete settings MSCGEN_PATH and TCL_SUBST from Doxyfile. The former would generate a warning in 1.8.16
while TCL support was removed in 1.8.18. Since TCL_SUBST was blank anyway, it was removed prior to getting
to .18 in production. Increased DOT_GRAPH_MAX_NODES from 50 to 200 since Doxygen complained about it being
too low for API and Maintenance.

Bug: T248706
Change-Id: I9c67f0807d1b43089d351263d4f591dee5501f36
2020-04-14 03:25:19 +00:00
David Barratt
f0e3f9f84b
Fix HTMLUsersMultiselectField validation when exists is true
The HTMLUsersMultiselectField and HTMLUserTextField fail validation when an
empty string is passed to a non-required form field. To prevent this, the
widget should pass the validation to the parent when the value is an empty
string.

Bug: T246958
Change-Id: I39df2b575b90a4648188ed3ef4cc0c38ac553636
2020-03-20 13:15:53 -04:00
Bartosz Dziewoński
68cbfcf3ed Use errorbox/warningbox for all HTMLFormField errors
Continuing the work for 441e12f2d9,
which did this for the main HTMLForm errors (grouped at the top of
the form). This handles errors for individual fields.

This fixes the display of error/warning messages on Special:CreateAccount,
and should not break anything else too badly (it helps that most forms
are using OOUI these days).

Bug: T246894
Change-Id: If1ccdff10bebe0c2eeca4c15d82271c9de1af164
2020-03-19 21:29:15 +01:00
BrandonXLF
f63ec91b3a Don't add dash to legend title if prefix is empty
Don't add a dash before $key when $this->mMessagePrefix is not set or is empty.

Bug: T248063
Change-Id: Ide3021a5550462ad2d51e5ac2e61f2807f61a8dd
2020-03-19 08:47:11 +00:00
Petr Pchelko
204fa7e509 Remove usages of deprecated Language methods
Change-Id: Iad3375b141b1d87c890baec6ecd16ed92f93e699
2020-02-16 00:45:48 +00:00
Thalia
fa0dfa9a0d HTMLUsersMultiselectField: Pass through config for widget's input
Bug: T245271
Change-Id: Icb449d4ea73c1513d6727d70ff3027c41e5ac059
2020-02-14 15:11:53 +00:00
Florian
c13605dba4 HTMLForm: Allow status object to have raw parameters
The status object, which can be returned after validating an HTMLForm,
can contain message objects. These message objects can be constructed
with the full feature set provided by Message, e.g. raw parameters.

The handling of these status objects in HTMLForm basically prevented
some features of the Message object in the status, as it parsed the
messages through the Parser, which does not recognize these raw
parameters as such and escapes them wrongly.

This behaviour is fixed with this change.

Bug: T240774
Change-Id: I152ec51f317799572bf6791e110cd72c42da82a0
2020-02-09 18:06:12 +01:00
James D. Forrester
0958a0bce4 Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNull
Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
2020-01-10 14:17:13 -08:00
James D. Forrester
4f2d1efdda Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse
Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
2020-01-10 09:32:25 -08:00
Timo Tijhof
326325b6de htmlform: Remove IE6-7 hack for <button> submit handler
This was a server-side check that made certain <button> elements
render as <input> for IE6 and IE7. MediaWiki no longer offers
basic support for these browsers per RFC T232563.

Change-Id: Ibd27b6fda3929bf94a5362a0369b3744e42de121
2020-01-05 23:16:58 +00:00
jenkins-bot
cf92c2dc44 Merge "Use namespaced IPUtils class" 2020-01-01 23:56:22 +00:00
Kunal Mehta
99007e96c7 Use namespaced IPUtils class
Change-Id: I047e099a93203a59093946d336a143d899d0271f
2020-01-01 02:36:49 -08:00
DannyS712
b92132e84f HTMLForm: Fix grammar of class description
"Other methods call done after that" should be "Other method calls
done after that" (though "Other methods called after that" would
work too.

Change-Id: I9fe8194647c134e6d2aea7b88c3fd4140ffb9883
2019-12-28 09:27:33 +00:00
jenkins-bot
9d8954a372 Merge "build: Upgrade phan to 0.9.0" 2019-12-09 16:15:27 +00:00
Daimona Eaytoy
ce0856b12f Fix more scalar types in docblocks
Change-Id: I574d4e261ab986e028c3ce26c4f0ec648b88a2ac
2019-12-08 17:59:08 +00:00
Daimona Eaytoy
598c4d7fcb build: Upgrade phan to 0.9.0
Scalar casts are still allowed (for now), because there's a huge amount
of false positives. Ditto for invalid array offsets.

Thoughts about the rest: luckily, many false positives with array offsets
have gone. Moreover, since *Internal issues are suppressed in the base
config, we can remove inline suppressions.

Unfortunately, there are a couple of new issues about array additions
with only false positives, because apparently they don't take
branches into account.

Change-Id: I5a3913c6e762f77bfdae55051a395fae95d1f841
2019-12-07 20:16:19 +00:00
Thiemo Kreuz
78ca9eff4a Remove duplicate variable name from class property PHPDocs
Repeating the variable name doesn't do anything. Documentation
generators don't need it. It's more stuff to read that doesn't add new
information. And it can become outdated.

Note there are two types of @var docs. When used inline (and not on a
class property) the variable name is needed.

Change-Id: If5a520405efacd8cefd90b878c999b842b91ac61
2019-12-02 12:58:29 +00:00
Thalia
16555e6f65 Add option for showing valid IPs in UsersMultiselectWidget menu
Pass through config options from HTMLUserTextField that allow the
field to accept an IP address and/or range, and specify the maximum
allowed range size.

Bug: T238277
Change-Id: I0e0f6b6fd6801d5cd561def28917e81a81b3f7d4
2019-11-15 21:42:32 +00:00
jenkins-bot
7b6b5a3590 Merge "preferences: Display error message at the top of the form as well" 2019-11-15 04:52:58 +00:00
Thalia
c0ce43bf5a Allow HTMLUsersMultiselectField to limit number of selected items
Bug: T238240
Change-Id: Ia2c046f3385ca0908f8c2756ba5f304ed8bed29d
2019-11-14 11:59:50 +00:00
Thalia
84552a9814 Improve error message for HTML multiselect fields
Introduce a more specific message for when the number of selected items
exceeds the maximum number allowed.

Change-Id: I359b65ac397b4acef32940ff8ff9af33651f7a7b
2019-11-14 04:57:35 +00:00
Bartosz Dziewoński
278b6e8506 preferences: Display error message at the top of the form as well
When there's an error in one of the fields "below the fold" or in
another tab, it's hard notice that it wasn't saved, especially since
the success message is very subtle.

In normal forms, there's a red error message at the top (in addition
to messages next to invalid fields), which was missing from the
preferences form.

I ran into this while experimenting with signature field validation.

Change-Id: If365e35d15a52939397f2093b1b8f5113a62e22b
2019-11-08 20:37:18 +01:00
Daimona Eaytoy
b5f0d61ee4 Fix new phan errors, part 8
Bug: T231636
Change-Id: I61852ba55362ab9ae8cc8c1ab6b27565ce1d08e7
2019-10-22 10:09:13 +02:00
Daimona Eaytoy
114ee6e412 Fix new phan errors, part 6
Bug: T231636
Change-Id: I1870b6cbeb31e54fde5e675fec51446b330e06c5
2019-10-20 17:53:48 +00:00
Daimona Eaytoy
95dc119527 Fix new phan errors, part 2
Still mostly doc-only.

Bug: T231636
Change-Id: I65cec6c716ce6859e14da00a12ef71e03603e59a
2019-10-12 10:35:09 +00:00
Umherirrender
8752df6592 Use varargs for MessageLocalizer::msg and similar
Bug: T191666
Change-Id: I59f2ae1a96af392026fc106e57d23553003c16b8
2019-10-05 17:47:49 +00:00
jenkins-bot
49fdec9c51 Merge "Use splat operator in signature, not func_get_args" 2019-10-03 18:56:50 +00:00
Gergő Tisza
f301dd5ce9
Fix HTMLForm::addButton label-message type annotation
Change-Id: I5dad560df0705976e104eec4d4159993e5bd0b66
2019-10-02 19:53:57 +02:00
Michael Große
a89f0997a3 Use splat operator in signature, not func_get_args
Most of the original scope of this patch was implemented in 8665536045

What remains is to use the splat operator in the method signature as
well which is more readable than using func_get_args and doesn't annoy
phan. This is now possible, because we are no longer testing on HHVM and
these mocking in HHVM tests was the only place where this was broken.

Change-Id: I52912d1810b955b05cd17fab424f80c201883411
2019-09-28 18:02:21 +00:00
Bartosz Dziewoński
97eab7f35b Improve collapsible HTMLForm styling (and accessibility, slightly)
Previously the form was only collapsible/expandable using the small
link-button on the far right. Now you can click on the entire header
to do it, and it has an appropriate pretty icon.

We add appropriate ARIA `role` and textual labels. Together with
recently added `toggleARIA` option of jquery.makeCollapsible in
Ic457bda58e56f we feature a screen reader workable output.

Bug: T222904
Change-Id: I6964296bc6870550478de662d21f12a1fc084c15
2019-09-23 10:57:26 -07:00
jenkins-bot
2c306b5fdf Merge "Messages collected above the form are meant to live as boxed messages" 2019-09-20 23:33:04 +00:00
jenkins-bot
31f66267ae Merge "HTMLTitleTextField: Remove incorrect check for unsubmitted GET forms" 2019-09-20 22:45:24 +00:00
Volker E
441e12f2d9 Messages collected above the form are meant to live as boxed messages
Also removing HTMLForm/VForm `.error` and `.warning` classes from
'forms.less'.

Bug: T233362
Change-Id: I4f8d8f228ab07253a7df24470791c26e39bc311a
2019-09-19 15:10:45 -07:00
Daimona Eaytoy
3439c00073 Suppress PhanUndeclaredProperty for custom properties and phan bugs
And remove the issue from the exclusions list.

Bug: T231636
Change-Id: Iee73ddb554e354abe52d13dcfc453f9a15bb8877
2019-09-14 13:22:54 +00:00
Daimona Eaytoy
290ab29617 Declare dynamic properties
This is for classes with a single undeclared property - aside from
BlockManager: I3f51fd3579514b83b567dfe20926df2f0930dc85 removed the
declaration of $permissionManager without actually removing all uses.

Change-Id: Ic2a95f77071312041be6e0633ea9b5325e98de42
2019-09-14 15:21:26 +02:00
Daimona Eaytoy
7862475b0d Improve various PHP method doc blocks
Follows-up 5eac6d131c.

Change-Id: I92c9d482fd8693a16b3967e763a4eb40b963c562
2019-09-05 18:45:40 +00:00
Daimona Eaytoy
b5cbb5ab3f Upgrade phan config to 0.7.1
This allows us to remove many suppressions for phan false positives.

Bug: T231636
Depends-On: I82a279e1f7b0fdefd3bb712e46c7d0665429d065
Change-Id: I5c251e9584a1ae9fb1577afcafb5001e0dcd41c7
2019-09-04 08:20:53 +00:00
Daimona Eaytoy
c659bc6308 Unsuppress another phan issue (part 7)
Bug: T231636
Depends-On: I2cd24e73726394e3200a570c45d5e86b6849bfa9
Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0
Change-Id: Ie6233561de78457cae5e4e44e220feec2d1272d8
2019-09-03 17:19:21 +00:00
Daimona Eaytoy
e2e543f7c2 Unsuppress more phan issues (part 5)
Bug: T231636
Depends-On: I6e5fba7bd273219b1206559420b5bdb78734aa84
Change-Id: I50377746f01749b058c39fd8229f9d566224cc43
2019-09-01 09:48:31 +00:00
Daimona Eaytoy
e70b5b3309 Unsuppress other phan issues (part 4)
Bug: T231636
Depends-On: I58e67c2b38389df874438deada4239510d21654f
Change-Id: I6e5fba7bd273219b1206559420b5bdb78734aa84
2019-08-31 17:13:39 +00:00
Daimona Eaytoy
5eac6d131c Unsuppress more phan issues (part 3)
Bug: T231636
Depends-On: I78354bf5f0c831108c8f606e50c87cf6bc00d8bd
Change-Id: I58e67c2b38389df874438deada4239510d21654f
2019-08-31 16:38:55 +00:00
Daimona Eaytoy
7f7efbe026 Globally unsuppress phan issues with low count
All of these suppression prevent the detection of many common mistakes,
and could easily prevent things like T231488. Especially if there are
few issues of a given type, it's way better to suppress them inline,
instead of disabling them for the whole core.
This patch only touches the one with a lower count (although those
counts may be out of date).

Bug: T231636
Change-Id: Ica50297ec7c71a81ba2204f9763499da925067bd
2019-08-30 09:40:47 +00:00
jenkins-bot
4306994b79 Merge "Allow SelectWithInput to be marked as required and handle that dynamically" 2019-07-31 13:28:54 +00:00
David Barratt
8a1f1ec631
Allow SelectWithInput to be marked as required and handle that dynamically
Alters the SelectWithInput to allow a required config to be passed from a
parent widget. Also handles the required state dynamically. If the widget is
an OR widget, then only the select dropdown is required. The text input will
be required when the other option is selected. If the widget is an AND widget
then both the select dropdown and the text input will be required.

Bug: T220533
Change-Id: I8479743126756f2b1bd7bcd53b100a0134f34d07
2019-07-30 16:33:02 -04:00
Thalia
ce965f9826 Fix punctuation in HTMLForm documentation
Change-Id: I22c4ed248fddc93afd486b9bee5a80bdbba1c685
2019-07-30 14:43:39 +01:00
Thalia
ffcb5928e1 Allow empty input in namespaces multiselect on Special:Block
Follow-up to 83ebbb519f

Bug: T219882
Change-Id: I5f3d907a8f8be02f9e2c23d2a66c42752daa38b5
2019-07-18 17:04:26 +01:00
Thalia
83ebbb519f Check namespace exists in HTMLNamespacesMultiselectField validation
Bug: T219882
Change-Id: I710d0abed6bd40dcea5bdd1c59c8d936565961eb
2019-07-16 18:07:10 +01:00
jenkins-bot
5b202d729d Merge "Adjust type hints in htmlform related classes" 2019-07-05 21:32:55 +00:00