-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade extension Thanks to MW 1.43 | Pull all Fandom patches into Thanks 1.43 #11
base: REL1_43
Are you sure you want to change the base?
Conversation
This reverts commit 761ce63.
This reverts commit 99ee461.
In 8e3838e, we augmented Thanks to also display "thank" link on Special:RecentChanges, and added logic to fetch the revision corresponding to each RecentChanges entry because it is necessary to render the link. However, this causes a DB lookup for each RecentChanges entry and so quickly becomes expensive. Instead, construct the revision object entirely using data already stored in the RecentChanges entry itself, akin to what ChangesList does internally. This avoids the problematic DB query altogether.
…rage for client cache" This reverts commit 39d01e3.
includes/Hooks.php
Outdated
* @param array $revisions Array with two elements, either nulls or RevisionRecord objects for | ||
* the two revisions that are being compared in the diff | ||
*/ | ||
public static function onBeforeSpecialMobileDiffDisplay( &$output, $ctx, $revisions ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check that because I don't know what that is, it's not in original commit dcbbee3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was disabled in extension.json before wikimedia/mediawiki-extensions-Thanks@REL1_39...Wikia:mediawiki-extensions-Thanks:REL1_39-Fandom-adjustments
af835e9
to
29728d4
Compare
…r breaking changes --amend
29728d4
to
f964994
Compare
@emkarcinos @kasperekt @dariuszpaluch @tmusial99 |
if ( !ThanksPermissions::checkUserPermissionsForThanks( RequestContext::getMain()->getOutput() ) ) { | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(non-blocking) This can be replaced with a hook invocation, that way Fandom code wouldn't be coupled with this class anymore. It's likely that the hook can be upstreamed, which will reduce the fork size in future versions.
$out = RequestContext::getMain()->getOutput(); | ||
|
||
// [UGC-4257] Don't show thank links if user doesn't have specific permission | ||
if ( !ThanksPermissions::checkUserPermissionsForThanks( $out ) ) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(non-blocking), same as above, invoke a hook
Task: https://fandom.atlassian.net/browse/PLATFORM-10109
Please review if I didn't break anything while resolving conflicts for each cherry-pick. List of pulled changes:
Special:Contributions
#6Some thoughts: I have to say that upgrading this and fetching our patches into
REL1_43
was a very painful process, as a result I've created this task - UGC-6220. I think we can either drop this fork and port all stuff into a custom extension or clean up this fork. I think it would be way easier to port changes if we introduce some minor changes (e.g., a dedicated file for our hooks - this way we won't need to resolve conflicts on the Hooks file in each commit but rather only conflicts in the extension.json; skipping changes related to the code sniffer, etc.). Additionally, I'd port all changes in a single commit.