Brion VIBBER has uploaded a new change for review.

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

Change subject: Fix broken section edit
......................................................................

Fix broken section edit

Change-Id: I6401611fb528b20701fd0156dda24ba788d03cde
---
M wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/00/185100/1

diff --git a/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m 
b/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m
index 0e1a236..a9ddb9e 100644
--- a/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m
+++ b/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m
@@ -496,8 +496,7 @@
             case FETCH_FINAL_STATUS_SUCCEEDED:{
                 NSMutableDictionary *editTokens =
                 [SessionSingleton 
sharedInstance].keychainCredentials.editTokens;
-                //NSLog(@"article.domain = %@", article.domain);
-                NSString *domain = [sender domain];
+                NSString *domain = self.section.site.language;
                 if (domain && tokenFetcher.token) {
                     editTokens[domain] = tokenFetcher.token;
                     [SessionSingleton 
sharedInstance].keychainCredentials.editTokens = editTokens;
@@ -707,14 +706,15 @@
 
     // If fromTitle was set, the section was transcluded, so use the title of 
the page
     // it was transcluded from.
+    MWKTitle *editTitle = self.section.fromtitle ? self.section.fromtitle : 
self.section.article.title;
 
     // First try to get an edit token for the page's domain before trying to 
upload the changes.
     // Only the domain is used to actually fetch the token, the other values 
are
     // parked in EditTokenFetcher so the actual uploader can have quick 
read-only
     // access to the exact params which kicked off the token request.
     (void)[[EditTokenFetcher alloc] initAndFetchEditTokenForWikiText: 
self.wikiText
-                                                           pageTitle: 
self.section.fromtitle
-                                                             section: 
self.section.index
+                                                           pageTitle: editTitle
+                                                             section: 
[NSString stringWithFormat:@"%d", self.section.sectionId]
                                                              summary: [self 
getSummary]
                                                            captchaId: 
self.captchaId
                                                          captchaWord: 
self.captchaViewController.captchaTextBox.text

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6401611fb528b20701fd0156dda24ba788d03cde
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to