Commit graph

104 commits

Author SHA1 Message Date
Prateek Saxena
5161ee2a65 LogEventsList: Stop showing deprecation warning when $input is empty
Follows-up on I697e158887fcca1da88763a4c929a981d9211490

Bug: T201006
Change-Id: I140cde3f71e2bd8106f0c0ce7da1ec822a8da072
2018-08-07 13:30:13 +05:30
Bartosz Dziewoński
23cd9d6d2e Prefill date in form on Special:Log when calling with old parameters
When the date is specified using &year=...&month=... URL parameters
rather than &wpdate=..., HTMLForm can't automatically fill it in,
but we can explicitly specify the default.

Bug: T199856
Change-Id: I71f4953d57a3893190778e5bd763db108dc433d3
2018-07-26 22:11:52 +02:00
Jayprakash12345
593f2f4276 Prefill username in form when calling Special:Log/<username>
Bug: T200446
Change-Id: I3f2fcedee8440d5943e556f7c1c06dfb1085e549
2018-07-26 22:20:56 +05:30
jenkins-bot
4db9564e50 Merge "LogEventsList: Correct typo" 2018-07-24 01:54:31 +00:00
jenkins-bot
8ef9135781 Merge "LogPager: Add backwards-compatibility for hide_[type]_log URL params" 2018-07-23 20:55:21 +00:00
Bartosz Dziewoński
5f7bf1942b LogEventsList: Correct typo
The parameter to getTitleInputDesc() is actually unused, so this was
not breaking anything.

Change-Id: Ia301faf511e30b4fc4542ccb80b24cf807cf731c
2018-07-23 18:18:04 +02:00
Prateek Saxena
f8a777b903 LogEventsList: Use DerivativeContext
Bug: T200136
Change-Id: Ie2b7753684dc0257b0b53d9c9314feeb14d99182
2018-07-23 09:52:36 +05:30
Prateek Saxena
8aaa50b6ef LogPager: Add backwards-compatibility for hide_[type]_log URL params
Also, the $default value in LogEventsList#getFiltersDesc was not
being generated properly and would have always been an empty array.

Bug: T199856
Change-Id: Id286c76259406521f12cda67a4a715032e022637
2018-07-20 07:18:46 +05:30
Max Semenik
9b0c621d7f Deprecate wfArrayFilter() and wfArrayFilterByKey()
Now that all our supported PHP versions have array_filter()
with a third parameter, these functions aren't needed anymore.

Depends-On: I3b097a1a048baabcaca15dc214a3a1bb06e746cc
Depends-On: I0187e27ac47cbab099249572201d1a649226a734
Change-Id: I7cabd0252691a083cb749cf9d3a7a23f1d076c39
2018-07-19 08:40:46 +02:00
jenkins-bot
a55a6f2424 Merge "LogEventsList: Remove options not used by HTMLForm" 2018-07-19 02:25:04 +00:00
jenkins-bot
6934d1db03 Merge "LogEventsList: Add backwards-compatibility for log-show-hide messages" 2018-07-18 21:03:59 +00:00
Bartosz Dziewoński
6205c06ebe LogEventsList: Remove options not used by HTMLForm
HTMLForm gets the input value from the request. The values
specified in the form descriptor were never used. (You can specify a
default value, but that uses the 'default' key anyway.)

Change-Id: I27934e1118492371e547dd5e94feb172a0510cc9
2018-07-18 19:55:07 +02:00
Prateek Saxena
682e4464a1 LogEventsList: Use GET in HTMLForm
I missed this during conversion.

Follows-up on Iba3c6aa5ac40dcdee0792c2d045b238b02d76521.

Bug: T199856
Change-Id: If3f228425b217c9ccdb7d32e0bc899647797ed70
2018-07-18 10:39:33 +05:30
Prateek Saxena
cab5b3afc7 LogEventsList: Add backwards-compatibility for log-show-hide messages
Also updated the release notes.

Bug: T199657
Change-Id: I027effbc7bd797ee241281ddd57334a5dc5c8a57
2018-07-18 09:49:36 +05:30
Prateek Saxena
52c62c65cd LogEventsListGetExtraInputs: Keep $input and add $formDescriptor
Follows-up on Iba3c6aa5ac40dcdee0792c2d045b238b02d76521.

Bug: T117737
Bug: T199495
Change-Id: I697e158887fcca1da88763a4c929a981d9211490
2018-07-17 20:35:55 +02:00
Prateek Saxena
38756eae46 Special:Log: Convert to HTMLForm
* All Xml generation code has been removed.

* The LogEventsListGetExtraInputs hook now needs a form
  descriptor array and not plain HTML.
  See I37e0d3e81a46239750465b9299279fbbd7c7f87a.

* LogPager and LogEventList also take the $day parameter
  for 'From date (and earlier)' and pass it to getDateCond
  as well.

* Since FormOptions can't automatically extract the date
  from the request this is being done manually in the
  execute method of Special:Log using MWTimestamp.

Bug: T117737
Change-Id: Iba3c6aa5ac40dcdee0792c2d045b238b02d76521
2018-07-10 16:55:33 +05:30
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
Matěj Suchánek
1000236bb9 Prevent "Undefined offset notice"
The number provided by the query can be arbitrary, so let's narrow the
input validation to booleans.

Bug: T194616
Change-Id: If03e6e2d5bbcf4f2d85047cc23ee5388b39fe114
2018-06-29 07:42:36 +00:00
Fomafix
125cbd8c01 Use \u{00A0} instead of &#160; or &nbsp;
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0) instead of
the HTML/XML entities &#160; or &#xa0; or &nbsp;.

With the UTF-8 character the generated HTML is shorter and better to read.

Also change the special value for the label in HTMLForm from &#160; to
U+00A0 but also support &#160; for backward compability.

Bug: T154300
Change-Id: I882599ac1120789bb4e524c4394870680caca4f4
2018-06-24 01:20:13 +00:00
Max Semenik
6e956d55aa Replace call_user_func_array(), part 2
Uses new PHP 5.6 syntax like ...parameter unpacking and
calling anything looking like a callback to make the code more readable.
There are much more occurrences but this commit is intentionally limited
to an easily reviewable size.

In one occurrence, a simple conditional instead of trickery was much more readable.

This patch finishes all the easy stuf in the core, the remainder is either unobvious
or would result in smaller readability gains. It will be carefully dealt with in
further commits.

Change-Id: I79a16c48bfb98b75e5b99f2f6f4fa07b3ae02c5b
2018-06-07 20:19:26 -07:00
Bartosz Dziewoński
286cdb8382 LogPager/LogEventsList: Correct docs about $pattern parameter
$pattern is a boolean, it is documented as "Do a prefix search rather
than an exact title match". However, its type was incorrectly
documented to be a string, and the default value was '' instead of
false (which was harmless, as it is correctly treated as a boolean
value everywhere).

Change-Id: Id093d12891a231d5934f9908e619065afff7380e
2018-05-10 19:46:59 +00:00
Thiemo Mättig
ef470ebf7f Remove @param comments that literally repeat what the code says
These comments do not add anything. I argue they are worse than having
no comments, because I have to read them first to understand they
actually don't explain anything. Removing them makes room for actual
improvements in the future (if needed).

Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
2018-01-10 14:14:26 +01:00
Umherirrender
ace44e2064 Use correct variable name in @param documentation
For some varargs a variable name is added with suffix ,... as seen for
many other varargs

Some @param are swapped, because there are in the wrong order

Enable Sniff MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

Change-Id: I60fec6025bce824d5c67563ab7b65ad6cd628ad8
2017-08-11 19:27:19 +02:00
Umherirrender
a9007e8baf Add missing & to @param documentation to match functon call
Change-Id: I81e68310abcbc59964b22e0e74842d509f6b1fb9
2017-08-11 18:47:46 +02:00
Thiemo Mättig
d14faa6bed Remove auto-generated "Constructor" documentation on constructors
Having such comments is worse than not having them. They add zero
information. But you must read the text to understand there is
nothing you don't already know from the class and the method name.

Change-Id: I994d11e05f202b880390723e148d79c72cca29f0
2017-07-10 10:15:51 +00:00
Kunal Mehta
80847dcb32 Expose LinkRenderer for LogFormatter instances
Pass a LinkRenderer instance from SpecialLog, through LogEventsList,
onto LogFormatter instances, which tend to make many links.

Bug: T168924
Change-Id: I264da6f63678917c7335adee5a0b64cbcded66f3
2017-06-30 02:05:29 -07:00
Aaron Schulz
82e2c924e4 Remove "@author Aaron Schulz" annotations
Bug: T139301
Change-Id: Ib5248e8e27d60611c7373bce4b29dd5e85aa3489
2017-06-27 15:24:14 -07:00
Gergő Tisza
016452cd09 ChangesList: Expose basic properties of lines as data attributes
We have several types of change lists (old RC/watchlist/related
changes, enhanced RC/watchlist, history) with slightly different
HTML, each with their own idiosyncracies. JavaScript code trying
to identify lines by log ID / revision ID has to jump through all
kinds of hoops to work with that.

To simplify the lives of frontend / gadget maintainers and provide
something approaching an API for these pages, we now expose the basic
attributes of each change line (revision ID for edits, log type/action
and ID for log events) as data attributes.

The OldChangesListRecentChangesLine, EnhancedChangesListModifyLineData,
EnhancedChangesListModifyBlockLineData, PageHistoryLine,
ContributionsLineEnding and DeletedContributionsLineEnding hooks
are updated accordingly. New hooks (LogEventsListLineEnding and
NewPagesLineEnding) are added for the change list pages which did
not yet have them.

Change-Id: I6dd006d0b1b0fd35c0020f0f9eea9113eca30b35
2017-06-08 23:19:45 +00:00
Aaron Schulz
488a647831 Move IDatabase/IMaintainableDatabase to Rdbms namespace
Change-Id: If7e8a8ff574661fd827de8bcec11d2c39a687300
2017-03-28 15:32:38 -07:00
Umherirrender
4d16c2ad56 Use Database::addQuotes instead of hard coded apostrophs
Change-Id: I1404d68d7e2b7fde8f9a76c747bc2be0936f7bef
2017-02-22 18:55:56 +01:00
Matěj Suchánek
87bfd03d13 Provide context to ChangeTags::buildTagFilterSelector
Bug: T105649
Change-Id: I5f44f4c054010c865ddb51e7d69107bdf2e88c00
2016-12-08 16:24:49 +00:00
Haikal Izzuddin
2c657ec256 Replace Linker::link() usage with LinkRenderer
Bug: T149346
Change-Id: Ie384566617f18ad6c3bf836b39702365d59f714d
2016-12-01 12:04:38 -08:00
Max Semenik
2b51bd1847 Fix function name case
Change-Id: Ibd4f682d2ed8500a50d85aae38f17281646f7c2d
2016-09-26 15:32:54 -07:00
Glaisher
9653f9b1d5 LogEventsList::showLogExtract: allow providing custom URL parameters for "view full log" link
Optional 'extraUrlParams' parameter has been added. This is useful for example when you want to
link to subtypes: Special:Log/foo?subtype=bar.
Also change Special:Log link to linkKnown() instead of link() while at it.

Change-Id: I87a6403eb0639c4d93e49d6946b85650f478107b
2016-05-22 18:04:45 +00:00
jenkins-bot
866f164873 Merge "Enable filtering by action on Special:Log" 2016-03-25 22:08:42 +00:00
Reedy
b5656b6953 Many more function case mismatches
Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
2016-03-19 00:20:58 +00:00
cenarium
d603a4477c Enable filtering by action on Special:Log
This allows logs to be filtered by log actions, provided
the log type has been set as such in config.
There is an index for log actions so the queries should
be performant enough (already used by API).

Extensions can use $wgActionFilteredLogs to filter their
own logs in the same way.

Bug: T20954
Change-Id: I6a61175f9a111c03d15b4d41751c818e3a411ff6
2016-03-14 19:20:14 +01:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Aashaka Shah
124026a712 Add IContextSource as parameter to ChangeTags::formatSummaryRow
Using IContextSource avoids the use of $wgLang and wfMessage which make
use of global $wgTtle.

Add IContextSource as parameter to ChangeTags::formatSummaryRow to avoid
globals. Define an IContextSource instance in all functions which
reference ChangeTags::formatSummaryRow and pass it in ChangeTags::formatSummaryRow
function call.

Also make the default value of IContextSource $context as null in
parameter, to avoid breaking changes for old callers in extensions.

Document default null value of IContextSource and add a @note to prefer
IContextSource over null value.

Remove trailing whitespace, and make code order according to parameter
order.

Bug: T105648
Change-Id: Ib54a6a96b73f6cd8fcdf8e520db2448a1e811cfa
2016-02-04 23:32:24 +05:30
Albert221
ed69044f80 Localization: Gave each special page its own message
Bug: T45502
Change-Id: I847c8b294d7e4596b229ad6180764c43c42af1e2
2015-12-13 16:16:25 +01:00
Bartosz Dziewoński
60e8b55856 Reduce usage of inline <span style="white-space: nowrap">
Inspired by T119055.

Change-Id: I6829a67fb77c00e87772983f35b884bf03fad7e3
2015-11-19 21:38:23 +01:00
Aaron Schulz
0f7893f877 Update various @params from DatabaseBase to IDatabase
Change-Id: I98e44cdffb0fc0d729f69f702799139afb988c20
2015-10-05 05:24:29 +00:00
cenarium
f827d5a261 Avoid muliple cache calls to explicitly defined tags
This avoids muliple cache calls to explicitly defined tags by
calling the showTagEditUI of ChangeTags only once in logs and
histories.

Change-Id: I2e36dbd96d3fcca06de0bf418bc6dc294d8d18d3
2015-06-14 20:02:30 +02:00
Brad Jorsch
a2415baa1a ChangeTags: Don't show UI when no editable tags exist
Bug: T97773
Change-Id: I001f15ca6f58bc9318eed84aa8ace2bddcb1b315
2015-05-01 11:12:31 -04:00
Brad Jorsch
4812913936 ChangeTags: Show checkbox on Special:Log when user lacks RevDel rights
The actual production of checkboxes in LogEventsList didn't get updated
to show checkboxes when the user can edit change tags but cannot use
RevDel on log entries.

This also renames LogEventsList::USE_REVDEL_CHECKBOXES to
LogEventsList::USE_CHECKBOXES to be accurate with the change here; no
extensions in Gerrit use this constant, so we should be safe.

Bug: T97501
Change-Id: I72ca7371fe73b650d5ef32d18da19788084f9aeb
2015-04-29 13:36:48 -04:00
Aaron Schulz
4bdbfe6c1b Removed BloomFilter classes
* This ends up being more complex than its worth
  and even more so for multi-DC support

Bug: T93006
Change-Id: Iaa774fe69061e42955b11dc82d30dba93208e606
2015-04-03 09:10:04 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
Aaron Schulz
09d9413795 Fixed regression that made log queries happen in spite of the bloom filter
Change-Id: I50f280a1db30cb1f9901a55a8a9558ebb2a9dffd
2014-11-20 09:03:29 +00:00
jenkins-bot
dd53b928b9 Merge "Add two hooks to allow for extensions to expose log_search values in the UI" 2014-11-06 23:00:16 +00:00
Fomafix
3055160858 Use getHtmlCode() instead of getCode() to set the lang attribute
The lang attribute of HTML elements should conform to BCP 47.

Bug: 72939
Change-Id: I9b4a734753af2c9dd7256eec60781553bc76edbf
2014-11-06 14:53:57 +00:00