jenkins-bot has submitted this change and it was merged.
Change subject: Skip stats cache purges on no-op edits
......................................................................
Skip stats cache purges on no-op edits
Bug: T102229
Change-Id: I9e9e7a00af359f25d1d73f12ec9067a916e07e25
---
M TranslateEditAddons.php
1 file changed, 9 insertions(+), 2 deletions(-)
Approvals:
Aaron Schulz: Looks good to me, but someone else must approve
Siebrand: Looks good to me, approved
jenkins-bot: Verified
diff --git a/TranslateEditAddons.php b/TranslateEditAddons.php
index e26a306..4cb5f34 100644
--- a/TranslateEditAddons.php
+++ b/TranslateEditAddons.php
@@ -176,8 +176,12 @@
}
$fuzzy = self::checkNeedsFuzzy( $handle, $text );
- self::updateFuzzyTag( $title, $rev, $fuzzy );
- wfRunHooks( 'TranslateEventTranslationEdit', array( $handle ) );
+ $fuzzyOp = self::updateFuzzyTag( $title, $rev, $fuzzy );
+
+ // Skip the hook if no change in status or content
+ if ( $revision || $fuzzyOp ) {
+ wfRunHooks( 'TranslateEventTranslationEdit', array(
$handle ) );
+ }
if ( $fuzzy === false ) {
wfRunHooks( 'Translate:newTranslation', array( $handle,
$rev, $text, $user ) );
@@ -228,6 +232,7 @@
* @param Title $title
* @param int $revision
* @param bool $fuzzy
+ * @param bool Whether status changed
*/
protected static function updateFuzzyTag( Title $title, $revision,
$fuzzy ) {
$dbw = wfGetDB( DB_MASTER );
@@ -245,6 +250,8 @@
} else {
$dbw->delete( 'revtag', $conds, __METHOD__ );
}
+
+ return (bool)$dbw->affectedRows();
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/218667
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9e9e7a00af359f25d1d73f12ec9067a916e07e25
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits