Commit graph

15 commits

Author SHA1 Message Date
jenkins-bot 593d23fd36 Merge "Don't store templatedata pageprop on doc-subpage" 2018-10-31 15:21:49 +00:00
Timo Tijhof 73aed63e0a ApiTemplateData: Address non-array count() warning on PHP 7.2
The $data value here comes from TemplateDataBlob which is always
an instance of stdClass. It has no items that make sense to count,
and the object was already being used as $data->params a few lines
higher, which means this count operation would always yield "1",
by proxy of count() effectively seeing the non-array as an array
containing the one non-array item.

Bug: T202087
Change-Id: If725aa8b4229613bf60290eb78654a42497056c8
2018-10-14 03:54:24 +01:00
Timo Tijhof 777ddee3aa ApiTemplateData: Use strict check for $langCode
This is assigned as boolean false or any string value.
The previous code used in implicit boolean cast to differentiate,
but the check is insufficient given that "" and "0" would also
cast to false. It is not the responsibility of this code to filter
those out.

Change-Id: I2cc707432b93703b29c49ac17d737f34119fc400
2018-10-14 03:52:55 +01:00
Timo Tijhof 29162276eb ApiTemplateData: Remove needless count() call
These variables always hold arrays, and to assert an array being
non-empty, boolean evaluation is reliable and suffices.

Change-Id: I5173f9d38ff52807a8025897115823d093052ecf
2018-10-14 03:51:38 +01:00
Umherirrender 8d0a3ea30c Update namespace for MediaWiki\Revision\RevisionRecord
Follow-Up: I16bea8927566a3c73c07e4f4afb3537e05aa04a5
Change-Id: Iae4f59a54a0fb65058ef43f51c5c819646935ac7
2018-10-11 19:56:27 +02:00
Timo Tijhof 326558fc77 Don't store templatedata pageprop on doc-subpage
This resolves two issues:
* Database inefficiency (T52512).
* Doc pages showing on Special:PageWithProp.

It also makes progress on (but doesn't fully resolve) T54448,
by not outputting encouraging accidental use of "/doc" by
displaying descriptions and parameter documentations for them
below the suggestions in VisualEditor.

Bug: T52512
Bug: T54448
Change-Id: I99323d7adc5fc072a85ff1d3595f805f537bbb43
2018-10-09 17:46:21 +00:00
jenkins-bot 49f1201621 Merge "Remove empty Default, Example and Auto value sections of the output table" 2018-09-28 16:08:34 +00:00
Agabi10 348edb68d2 Remove empty Default, Example and Auto value sections of the output table
Bug: T125333
Change-Id: I1f7135cdf22c04aaa31744096900fd7ea65f9a37
2018-09-28 15:24:14 +00:00
Volker E e06b2b1686 Replace deprecated 'advanced' by renamed to 'settings' icon
One more, after my comment in I997bc0f8c7d99f73c1cc6b4ce46f6bcdc1eee410
got happily ignored.

Bug: T190581
Change-Id: I26dc9018693ffd4c5edcda021c8adce52325cdc9
2018-09-12 12:49:10 -07:00
Sam Wilson 79e5347d90 Prevent leading hash from starting param names when guessing
Parameter names can be constructed with parser functions, so
we should not include these as raw parameter names. There
might be more characters to add here.

Bug: T203605
Change-Id: If57a9ed7edf1e881cd121d9a1bcb2e7455c04ec9
2018-09-12 10:04:45 +08:00
jenkins-bot 6d438766c8 Merge "Fix problems with MediaWiki messages and non-displaying icons" 2018-09-09 10:41:50 +00:00
Saint Johann c608d204c1 Fix problems with MediaWiki messages and non-displaying icons
Bug: T160252
Change-Id: I997bc0f8c7d99f73c1cc6b4ce46f6bcdc1eee410
2018-09-03 17:14:16 +02:00
Sam Wilson bc1422b788 Ignore subsequent similarly-named parameters when extracting
When extracting raw parameters from wikitext, ignore those that
only differ from already-found ones by spaces, underscores, or
hyphens.

Bug: T193265
Change-Id: I012e06bf4353eaaf0613124d7d6b88f3444d248a
2018-08-27 11:14:27 +08:00
Sam Wilson f5fece10fd Guess template parameters when templatedata is missing
Deprecate the 'doNotIgnoreMissingTitles' parameter and
replace it with 'includeMissingTitles'. If this parameter
is requested 'raw parameters' will be added to the
response in the same format as templatedata parameters.
Raw parameters are those that *might* be in the
template (using the same logic as the TemplateData generator
wizard).

Also fix the example that was using a falsy value which
meant the option was enabled rather than disabled as it
says in the docs.

Bug: T191756
Change-Id: Ie5fe2097cda45968bb080643d3afcac0b2868a6c
2018-04-25 11:42:18 -07:00
Kunal Mehta de96754626 Move PHP classes to includes/
Change-Id: I7f46b6da2995687b3ec1ed95cf6f35c2a40d4f1e
2018-04-24 16:50:31 -07:00