[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Fix the js error while loading a translation with saved tran...

2017-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/378199 )

Change subject: Fix the js error while loading a translation with saved 
translation
..


Fix the js error while loading a translation with saved translation

This will not make the restore-translation feature working.
Just prevents the js error that prevents loading the source article
to translation view.

Change-Id: I28fcd0b7885b333c5cfbce6946f3fe04133ce3f9
---
M modules/dm/mw.cx.dm.Translation.js
M modules/mw.cx.TranslationController.js
2 files changed, 10 insertions(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Nikerabbit: Looks good to me, approved



diff --git a/modules/dm/mw.cx.dm.Translation.js 
b/modules/dm/mw.cx.dm.Translation.js
index 36c9cbf..4f1e176 100644
--- a/modules/dm/mw.cx.dm.Translation.js
+++ b/modules/dm/mw.cx.dm.Translation.js
@@ -281,6 +281,15 @@
return this.translationUnitById[ id ];
 };
 
+/**
+ * Get a translation units
+ *
+ * @return {mw.cx.dm.TranslationUnit[]} The translation units
+ */
+mw.cx.dm.Translation.prototype.getTranslationUnits = function () {
+   return this.topTranslationUnits;
+};
+
 mw.cx.dm.Translation.prototype.getProgress = function () {
return this.progress;
 };
diff --git a/modules/mw.cx.TranslationController.js 
b/modules/mw.cx.TranslationController.js
index c5fb722..45e8023 100644
--- a/modules/mw.cx.TranslationController.js
+++ b/modules/mw.cx.TranslationController.js
@@ -292,7 +292,7 @@
 
this.translation.getTranslationUnits().forEach( function ( unit ) {
var savedSection, provider, document,
-   sectionId = unit.getSectionId();
+   sectionId = unit.getId();
 
if ( !savedUnits[ sectionId ] ) {
return;

-- 
To view, visit https://gerrit.wikimedia.org/r/378199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I28fcd0b7885b333c5cfbce6946f3fe04133ce3f9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Fix the js error while loading a translation with saved tran...

2017-09-14 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378199 )

Change subject: Fix the js error while loading a translation with saved 
translation
..

Fix the js error while loading a translation with saved translation

This will not make the restore-translation feature working.
Just prevents the js error that prevents loading the source article
to translation view.

Change-Id: I28fcd0b7885b333c5cfbce6946f3fe04133ce3f9
---
M modules/dm/mw.cx.dm.Translation.js
M modules/mw.cx.TranslationController.js
2 files changed, 10 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/99/378199/1

diff --git a/modules/dm/mw.cx.dm.Translation.js 
b/modules/dm/mw.cx.dm.Translation.js
index 36c9cbf..774b86f 100644
--- a/modules/dm/mw.cx.dm.Translation.js
+++ b/modules/dm/mw.cx.dm.Translation.js
@@ -281,6 +281,15 @@
return this.translationUnitById[ id ];
 };
 
+/**
+ * Get a translation units
+ *
+ * @return {mw.cx.dm.TranslationUnit|undefined} The translation unit
+ */
+mw.cx.dm.Translation.prototype.getTranslationUnits = function () {
+   return this.topTranslationUnits;
+};
+
 mw.cx.dm.Translation.prototype.getProgress = function () {
return this.progress;
 };
diff --git a/modules/mw.cx.TranslationController.js 
b/modules/mw.cx.TranslationController.js
index c5fb722..45e8023 100644
--- a/modules/mw.cx.TranslationController.js
+++ b/modules/mw.cx.TranslationController.js
@@ -292,7 +292,7 @@
 
this.translation.getTranslationUnits().forEach( function ( unit ) {
var savedSection, provider, document,
-   sectionId = unit.getSectionId();
+   sectionId = unit.getId();
 
if ( !savedUnits[ sectionId ] ) {
return;

-- 
To view, visit https://gerrit.wikimedia.org/r/378199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28fcd0b7885b333c5cfbce6946f3fe04133ce3f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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