summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Translate/TranslateEditAddons.php')
-rw-r--r--MLEB/Translate/TranslateEditAddons.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/MLEB/Translate/TranslateEditAddons.php b/MLEB/Translate/TranslateEditAddons.php
index d128ee6d..b8442c1b 100644
--- a/MLEB/Translate/TranslateEditAddons.php
+++ b/MLEB/Translate/TranslateEditAddons.php
@@ -193,11 +193,11 @@ class TranslateEditAddons {
* @param string $_1
* @param bool $_2
* @param int $flags
- * @param Revision $revision
+ * @param Revision|null $revision
* @return true
*/
- public static function onSave( WikiPage $wikiPage, $user, $content, $summary,
- $minor, $_1, $_2, $flags, $revision
+ public static function onSave( WikiPage $wikiPage, User $user, Content $content, $summary,
+ $minor, $_1, $_2, $flags, Revision $revision = null
) {
global $wgEnablePageTranslation;
@@ -227,11 +227,11 @@ class TranslateEditAddons {
$group = $handle->getGroup();
// Update translation stats - source language should always be up to date
if ( $handle->getCode() !== $group->getSourceLanguage() ) {
- MessageGroupStats::forItem(
- $group->getId(),
- $handle->getCode(),
- MessageGroupStats::FLAG_NO_CACHE
- );
+ // This will update in-process cache immediately, but the value is saved
+ // to the database in a deferred update. See MessageGroupStats::queueUpdates.
+ // In case an error happens before that, the stats may be stale, but that
+ // would be fixed by the next update or purge.
+ MessageGroupStats::clear( $handle );
}
MessageGroupStatesUpdaterJob::onChange( $handle );