jenkins-bot has submitted this change and it was merged. Change subject: Simplify tracking of changed units and fix invalidation ......................................................................
Simplify tracking of changed units and fix invalidation * There were two almost identical checks in different places ** First check failed because assignment was written as comparison ** Second check did not change the correct variable * Do not store the changed sections anymore - no longer used Bug: 47178 Change-Id: I44a4b5ae96fac6fb8110436c420a92f0640302de --- M tag/SpecialPageTranslation.php 1 file changed, 5 insertions(+), 16 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/tag/SpecialPageTranslation.php b/tag/SpecialPageTranslation.php index 796845c..fa1c0db 100644 --- a/tag/SpecialPageTranslation.php +++ b/tag/SpecialPageTranslation.php @@ -427,12 +427,6 @@ } $usedNames[$s->id] = true; $s->name = $s->id; - - // Allow silent changes to avoid fuzzying unnecessary. - if ( $request->getCheck( "tpt-sect-{$s->id}-action-nofuzzy" ) ) { - $s->type === 'old'; - } - } return $sections; @@ -658,12 +652,11 @@ */ foreach ( array_values( $sections ) as $index => $s ) { $maxid = max( $maxid, intval( $s->name ) ); + $changed[] = $s->name; - if ( $s->type === 'changed' ) { - // Allow silent changes to avoid fuzzying unnecessary. - if ( !$this->getRequest()->getCheck( "tpt-sect-{$s->id}-action-nofuzzy" ) ) { - $changed[] = $s->name; - } + if ( $this->getRequest()->getCheck( "tpt-sect-{$s->id}-action-nofuzzy" ) ) { + // This will be checked by getTranslationUnitJobs + $s->type = 'old'; } $inserts[] = array( @@ -683,10 +676,7 @@ $dbw->insert( 'translate_sections', $inserts, __METHOD__ ); TranslateMetadata::set( $page->getMessageGroupId(), 'maxid', $maxid ); - /* Stores the names of changed sections in the database. They are - * used for calculating completion percentages for outdated translations. - * For prettiness use null instead of empty array */ - $page->addMarkedTag( $newrevision, $changed === array() ? null : $changed ); + $page->addMarkedTag( $newrevision ); MessageGroups::clearCache(); $jobs = self::getRenderJobs( $page ); @@ -697,7 +687,6 @@ // Logging $this->handlePriorityLanguages( $this->getRequest(), $page, $this->getUser() ); - $entry = new ManualLogEntry( 'pagetranslation', 'mark' ); $entry->setPerformer( $this->getUser() ); -- To view, visit https://gerrit.wikimedia.org/r/60660 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I44a4b5ae96fac6fb8110436c420a92f0640302de Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: Siebrand <siebr...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits