Nikerabbit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/60660


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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/60/60660/1

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: newchange
Gerrit-Change-Id: I44a4b5ae96fac6fb8110436c420a92f0640302de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to