aboutsummaryrefslogtreecommitdiffstats
path: root/includes/changes
Commit message (Collapse)AuthorAgeFilesLines
...
| * ChangesList: Cache user linksMatěj Suchánek2023-08-201-12/+25
| | | | | | | | | | | | | | | | | | Follow up to a468534. The caching added to RCCacheEntryFactory would be utilized only by EnhancedChangesList. This should improve performance for OldChangesList, too. Bug: T341319 Change-Id: Ibb1907732c71d0783d1a627063debb2a484cafe7
* | Merge "mark various anonymous functions as static"jenkins-bot2023-08-231-2/+2
|\ \
| * | mark various anonymous functions as staticReedy2023-08-221-2/+2
| |/ | | | | | | Change-Id: Iefe896769359f0d32e52bf20aa03e1c3715d5074
* / RecentChange: Drop getEngine(), deprecated since 1.29James D. Forrester2023-08-231-25/+0
|/ | | | Change-Id: Iad19dc62c4a06ccdb553ed11b3390679c761e17e
* Merge "Cache some more repeated messages in changes lists"jenkins-bot2023-08-191-2/+2
|\
| * Cache some more repeated messages in changes listsMatěj Suchánek2023-08-191-2/+2
| | | | | | | | Change-Id: I635eaf947280fd1071e308b19715d581e1c1cb15
* | Reorg: Move MWTimestamp to MediaWiki\UtilsAmir Sarabadani2023-08-191-0/+1
|/ | | | | Bug: T321882 Change-Id: I48c10343295c4eb3d9ef8037343b0070e928f040
* ChangesList: Call MapCacheLRU::makeKeyMatěj Suchánek2023-08-161-1/+6
| | | | | | | Also split the cache by context, like it's done in ::insertTags. Follows-up 17deb8353b (I0b5e48ef5). Change-Id: I5b539a63c3210a8cd1debb2ba625b0f2dedacc39
* Merge "Mass migrate Database::insert calls to InsertQueryBuilder"jenkins-bot2023-08-081-1/+4
|\
| * Mass migrate Database::insert calls to InsertQueryBuilderAmir Sarabadani2023-08-071-1/+4
| | | | | | | | | | | | | | Done automatically based on a php parser written on top of ANTLR4 Bug: T335377 Change-Id: Ie8fabc594edab18e55cb1d5bbf573762106e3d71
* | objectcache: Add MapCacheLRU::makeKey() and adopt in ChangesListTimo Tijhof2023-08-032-12/+9
|/ | | | | | This came up during code review of change I91588aebae7e49e3d3c. Change-Id: I0b5e48ef52513f012bfbb460ab5a649178ebf255
* Consistently use LogicException for test-only methodsthiemowmde2023-07-221-1/+1
| | | | | | | | | | | | "BadMethodCallException" sounds like it would fit, but it does have a very different meaning, described as "exception thrown if a callback refers to an undefined method or if some arguments are missing". This is not what's going on here. These are methods that should only be called from unit tests. This appears to be a common mistake, often copy-pasted. Change-Id: Ib39e28f596a883481d5f526460a5c871c75f5313
* Merge "RecentChanges: Add process caching to RecentChanges UserLinks and ↵jenkins-bot2023-07-202-22/+77
|\ | | | | | | Tags parsing"
| * RecentChanges: Add process caching to RecentChanges UserLinks and Tags parsingttomalak2023-07-182-22/+77
| | | | | | | | | | | | | | Rendering UserLinks or Tags requires parsing, which when run on thousands of records, adds up to a significant amount of processing time. More often than not, this can be optimized by storing already visited tags or user links as those "renders" will not change for the single request run and are repeated constantly on the list. Bug: T341319 Change-Id: I91588aebae7e49e3d3cb77702cf28677b4a14c8d
* | EnhancedChangesList: Use HTML/CSS for collapsingFomafix2023-07-131-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The collapsing on the enhanced changes list now works without JavaScript. Keyboard navigation is still supported but only the space and not the return toggles the collapsing toggle button. The <input type="checkbox"> element needs an unique identifier in the `id` attribute and the same value must be in the `for` attribute of the <label> element. A simple counter in the class EnhancedChangesList starts twice from the beginning if the recent changes get included as: {{Special:RecentChanges|enhanced=1}} {{Special:RecentChanges|enhanced=1}} Therefore a random value is used as checkbox identifier. The module 'jquery.makeCollapsible' and its classes `mw-collapsible`, `mw-collapsed` and `mw-collapsible-toggle-collapsed` are not needed anymore. The icons from module 'mediawiki.icon' are directly included because the module has fixed selectors which do not fit here. Bug: T172618 Change-Id: Iafd27e5d760b78ae386d833946005f86cee8dd64
* | Replace array_keys in foreach to use $_ as value insteadUmherirrender2023-07-101-1/+1
|/ | | | | | | | When the value of the associated array is not used, there is no need to use array_keys and create internal a copy of the array, just omit the value with $_ to tell static analyzer that the var is unused. Change-Id: I5c6d667e98c0167c0573c683f0d617bc1d4ca619
* Collapse sequences of `if` into short `return` if possiblethiemowmde2023-06-151-11/+5
| | | | | | | The main goal is to make this code faster and easier to read, and to avoid duplication. Change-Id: I925d742d560e9d90e3ecc9ff19fe7e87b60bf9a4
* Replace deprecated MWExceptionDaimona Eaytoy2023-06-122-9/+0
| | | | | Bug: T328220 Change-Id: I0408575ee71e58d1c9e9ebedabab35bd3813f515
* Replace some more usages of deprecated MWExceptionDaimona Eaytoy2023-06-092-7/+4
| | | | | Bug: T328220 Change-Id: I3c36835fbd90acc301731e2b33ae4815cd4b0cc5
* Migrate Database::update() to UpdateQueryBuilderAmir Sarabadani2023-06-081-10/+5
| | | | | | | | I did this using a script written on top of antlr4 parser so it doesn't have some clean ups a human would do but it's pretty nice already. Bug: T330640 Change-Id: I608566700c6d737ee986bf47dda87effc69614d6
* rcfeed: Add 'notify_url' and 'title_url' to MachineReadableRCFeedFormatterTimo Tijhof2023-05-191-0/+39
| | | | | | | | | | | | | | | | | | * Move the current URL logic from IRCColourfulRCFeedFormatter to a new method RecentChange::getNotifyUrl (covered by tests now). * Re-use this method in MachineReadableRCFeedFormatter so that the diff/patrol/rcid etc URL is also available in the modern JSON-based EventStreams service. And in particular to allow porting of the legacy irc.wikimedia.org backend to a much simpler one that is based on this. * Also expose a title_url field which was previously missing, and made consumption of the data needlessly difficult. Bug: T234234 Depends-On: Id740134ef30b2276688d7b7caedb6bb652158761 Change-Id: Ic3e0aebdb61b5c0e5fbed08656db4a1e90b67518
* Replace internal Hooks::runnerUmherirrender2023-05-112-8/+14
| | | | | | | | | The Hooks class contains deprecated functions and the whole class is going to get removed, so remove the convenience function and inline the code. Bug: T335536 Change-Id: I8ef3468a64a0199996f26ef293543fcacdf2797f
* EnhancedChangesList: Make format of categorization entries consistentMatěj Suchánek2023-04-041-4/+6
| | | | | | | | | | Make this subroutine same as that in ::recentChangesBlockLine. This solves the illogical issue where diff links would be displayed only for ungrouped categorization entries, but not within groups of them, making such entries useless for patrolling. Bug: T270662 Change-Id: Ib4f02673cb47b42fcb1c2268691ca41cd637b0c5
* Fix more PHPStorm inspections (#2)Tim Starling2023-03-251-1/+1
| | | | | | | | | | | | | | | * Illegal string offset and invalid argument supplied to foreach, due to incorrect type information * Array internal pointer reset is unnecessary * $hookData unused since MW 1.35 due to incomplete revert * array_push() with single element * Unnecessary sprintf() * for loop can be replaced with str_repeat() * preg_replace() can be replaced with rtrim() * array_values() call is redundant * Unnecessary cast to string * Unnecessary ternary. Often the result relies on short-circuit evaluation, but I find it more readable nonetheless. Change-Id: I4c45bdb59b51b243fa96286bec8b58deb097d707
* Allow marking recent changes about logged actions with bot flagMatěj Suchánek2023-03-131-3/+11
| | | | | | | | | There was no clean way to do this but using the global state. The parameter is three-state to keep backward compatibility. Bug: T304428 Change-Id: I01c5f8e9646cbe861516100c3b8d165aefb95ca0
* Reorg: Namespace the Title classJames D. Forrester2023-03-027-1/+7
| | | | | | | | | | | | | | | | | | | This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
* Merge "EnhancedChangesList: Fix curid for permalinks"jenkins-bot2023-03-011-19/+21
|\
| * EnhancedChangesList: Fix curid for permalinksMatěj Suchánek2023-02-261-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | The code assumed that curid is same for all changes in the block (more precisely, the first one applies to all others). This is not true when the block includes categorization changes. Refactor the code to prefer individual link params instead of global approach. Bug: T270774 Change-Id: Id2286392239b67a44fbb2e95346daad9fc2a0e4f
* | RCCacheEntryFactory: Don't make a "cur" link for newest revisionMatěj Suchánek2023-02-261-1/+4
|/ | | | | Bug: T34038 Change-Id: I94d63d708b5ef0ed15dcb2c4a5bff4d2300625f0
* EnhancedChangesList: Isolate categorization entries in getLogTextMatěj Suchánek2023-02-261-10/+17
| | | | | | | | | | | | | | | | | | | rc_this_oldid and rc_last_oldid of categorization entries reference revisions of the page that had its categorization changed rather than the category page itself. These should not be considered when building the diff link(s). Introduce new aggregate variable $allCategorization and use it instead of examining $rcObj (which deals only with the last change in the block). Finally, drop the ::userCan check deciding whether the user can see the diff. It wouldn't work properly either, because it would check only the last (oldest) entry in the block, not the first (newest) and the one before the last. Bug: T261068 Change-Id: I10bdfbad9d8a36f210ffd11a832604104f8ecdc5
* Merge "EnhancedChangesList: Rewrite bogus condition"jenkins-bot2023-02-261-1/+1
|\
| * EnhancedChangesList: Rewrite bogus conditionMatěj Suchánek2023-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was definitely already wrong when it was added in 2008 (r33013). !$type will return true for RC_EDIT (!0), false for all other types (RC_NEW, RC_LOG, etc.). The weak equality comparison then casts RC_LOG to boolean (3 -> true). So the first condition will pass if and only if $type is RC_EDIT. As this piece of code lasted for 15 years and there seems to be no objection to the behavior, I just rewrite it to make it more clear and keep the same behavior. Cudos to Thiemo Kreuz who disassembled the code. Change-Id: I93f853b2a191fc3011b47fcd1ac22ac649ce541a
* | EnhancedChangesList: Consistent order of link attributesMatěj Suchánek2023-02-251-1/+1
|/ | | | | | | Keep action=history after curid=, like was done in 39783472b. Follows up I1aa3be64f9b4e9c63cb72037b131361616f76292. Change-Id: Ie319052754c910857adca370e1d7c8b8ff9d7618
* Merge "Reorg: Move HTML-related classes out of includes/ to Html/"jenkins-bot2023-02-219-0/+12
|\
| * Reorg: Move HTML-related classes out of includes/ to Html/Amir Sarabadani2023-02-169-0/+12
| | | | | | | | | | Bug: T321882 Change-Id: I5dc1f7e9c303cd3f5b9dd7010d6bb470d8400a18
* | Merge "Clean up EnhancedChangesList::getLogText"jenkins-bot2023-02-181-23/+16
|\ \
| * | Clean up EnhancedChangesList::getLogTextMatěj Suchánek2023-02-161-23/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No functional changes, pure refactoring. - Merge two loops over the same array. - Move "enhancedrc-since-last-visit" message generation where it actually is needed. This should save a bit of time. - Store the title in a variable. - New-style comments. Change-Id: I1aa3be64f9b4e9c63cb72037b131361616f76292
* | | Simplify RCCacheEntryFactory::buildCLinkMatěj Suchánek2023-02-161-5/+2
| |/ |/| | | | | | | | | | | | | This branch has the identical output as the default one. There is probably no reason for unpatrolled new pages to be handled separately (and skip check for special pages). Change-Id: I1f2f2dcc6fe9f6b4a6b2f6d920adb6eede5fdc1f
* | Use the ?? operator in a few places where it makes sensethiemowmde2023-02-141-5/+2
| | | | | | | | | | | | … and where it improves readability, in my opinion. Change-Id: I4f3bc6067dfac16841ed74c00a4c81215d0f5249
* | Merge "OldChangesList: Pass revision ID through to user link"jenkins-bot2023-02-071-2/+6
|\ \
| * | OldChangesList: Pass revision ID through to user linkThalia2023-01-301-2/+6
| | | | | | | | | | | | | | | Bug: T326396 Change-Id: I09a407f24572312c9ec2ce9653ebbf28ea7819c1
* | | watchlist: Re-centralise former wgUseEnotif conditionTimo Tijhof2023-02-021-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | Follows-up I9bfa502a0b (9b8f153f). Also document the reason for this logic, to the best of my knowledge, and some ideas to improve it. Bug: T305093 Change-Id: I4c5bf4d4da83ff1e03d0fe0dd9891507b1f1e455
* | | Select recent changes for deletion only by page idMatěj Suchánek2023-02-011-1/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem this patch fixes: - Step 1: Move an existing page A to a new title B. - Step 2: Delete the redirect at the old title A. - What happened: All the edits made to the page prior to the move are gone from recent changes. - What should have happened: all the edits made to the page prior to the move are still in recent changes under the (now redlinked) title A. Contrary to that, moving a page with redirect suppression would preserve the changes. Bug: T140960 Bug: T307865 Change-Id: Ib52a9c657620275388012a778bc9d839dd740624
* | EnhancedChangesList: Add latest revision ID to top level user linkThalia2023-01-301-8/+11
| | | | | | | | | | | | Bug: T326395 Bug: T326396 Change-Id: Ia3966f59c271e3c9826c170ffb580715f4ee5a35
* | Add revision id to recent changes entrySTran2023-01-261-1/+4
|/ | | | | | Bug: T326395, T326396 Depends-On: I6b98a2f9a59922eb923bad8c39cad05514b5fc66 Change-Id: If70d610c98fb56d957d947a61310064afef2c367
* Replace more usages of MWExceptionDaimona Eaytoy2023-01-264-20/+16
| | | | | Bug: T86704 Change-Id: I14abf71b7dcf432d0eb35f0b4ab2fa4fb797e2e8
* Make history URL for category change consistent with other history linksNardog2023-01-121-2/+2
| | | | | | | | | I9cae1afa made the order of 'curid=...' and 'action=history' in the history links for category changes inconsistent with other history links on the changeslist. Bug: T264491 Change-Id: I311c375d9250ab8a92bcf8e0b79af9e075487f96
* Use CommentStore service instead of deprecated methodDerick Alangi2023-01-041-10/+9
| | | | | | | | Also, added a parameters to XmlDumpWriter so that they could be inject via WikiExporter. Bug: T325475 Change-Id: I84b82506509e2c09dad0691af2df958a5af5b5b0
* Split a base class out of CommentStoreAlexander Vorwerk2023-01-011-0/+1
| | | | | | | | | | so that extensions (i.e. CheckUser) can implement their own comment store without having a lot of code duplication basically the comment store version of I3a6486532f2ef36 Bug: T233004 Change-Id: Ib40f99e00a514d41776ce521baf113e46d37e9cd
* Replace some tivial ??= with even more trivial ??thiemowmde2022-12-231-2/+1
| | | | | | | | | Patch Ifa7a9bc replaced some longer `=== null` constructs with the new ??= operator we have since PHP 7.4. However, some of these can be simplified even more with the ?? operator we have since PHP 7.0. Follow-Up: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b Change-Id: I7b05e723810558bb5437adc97eab54ca04d38c06