[MediaWiki-commits] [Gerrit] Drop bad ext. HTML and continue html2wt instead of returning... - change (mediawiki...parsoid)

2015-08-27 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review.

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

Change subject: Drop bad ext. HTML and continue html2wt instead of returning 
HTTP 500
..

Drop bad ext. HTML and continue html2wt instead of returning HTTP 500

* On occasion, because of client bugs, we get ref tags that cannot
  be serialized properly (see T110479).

* Instead of refusing to serialize the rest of the page, just drop
  such extensions on the floor and continue with the rest of the page.
  This at least prevents users from losing rest of their work because
  of failures to save the page.

Change-Id: I3dd4b25c6ddbd77246871aa773f299e3a894d7ae
---
M lib/mediawiki.WikitextSerializer.js
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/33/234333/1

diff --git a/lib/mediawiki.WikitextSerializer.js 
b/lib/mediawiki.WikitextSerializer.js
index 37b6ab6..53ea27d 100644
--- a/lib/mediawiki.WikitextSerializer.js
+++ b/lib/mediawiki.WikitextSerializer.js
@@ -623,11 +623,12 @@
extraDebug = ' 
[reference ' + href + ' not found]';
}
}
-   // Bail out of here since we cannot 
meaningfully recover
-   // from this without losing content and 
corrupting the page.
-   state.env.log(fatal/request,
-   extension src id  + 
dataMW.body.id +  points to non-existent element for: ,
-   node.outerHTML + extraDebug);
+
+   // Log an error and drop the extension 
call
+   state.env.log(error/ + extName,
+   extension src id  + 
dataMW.body.id +  points to non-existent element for:,
+   node.outerHTML, . Dropping the 
extension. More debug info: , extraDebug);
+   return '';
}
}
if (htmlText) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3dd4b25c6ddbd77246871aa773f299e3a894d7ae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry ssas...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Drop bad ext. HTML and continue html2wt instead of returning... - change (mediawiki...parsoid)

2015-08-27 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Drop bad ext. HTML and continue html2wt instead of returning 
HTTP 500
..


Drop bad ext. HTML and continue html2wt instead of returning HTTP 500

* On occasion, because of client bugs, we get ref tags that cannot
  be serialized properly (see T110479).

* Instead of refusing to serialize the rest of the page, just drop
  such extensions on the floor and continue with the rest of the page.
  This at least prevents users from losing rest of their work because
  of failures to save the page.

Change-Id: I3dd4b25c6ddbd77246871aa773f299e3a894d7ae
---
M lib/mediawiki.WikitextSerializer.js
1 file changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Arlolra: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/lib/mediawiki.WikitextSerializer.js 
b/lib/mediawiki.WikitextSerializer.js
index 37b6ab6..53ea27d 100644
--- a/lib/mediawiki.WikitextSerializer.js
+++ b/lib/mediawiki.WikitextSerializer.js
@@ -623,11 +623,12 @@
extraDebug = ' 
[reference ' + href + ' not found]';
}
}
-   // Bail out of here since we cannot 
meaningfully recover
-   // from this without losing content and 
corrupting the page.
-   state.env.log(fatal/request,
-   extension src id  + 
dataMW.body.id +  points to non-existent element for: ,
-   node.outerHTML + extraDebug);
+
+   // Log an error and drop the extension 
call
+   state.env.log(error/ + extName,
+   extension src id  + 
dataMW.body.id +  points to non-existent element for:,
+   node.outerHTML, . Dropping the 
extension. More debug info: , extraDebug);
+   return '';
}
}
if (htmlText) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3dd4b25c6ddbd77246871aa773f299e3a894d7ae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry ssas...@wikimedia.org
Gerrit-Reviewer: Arlolra abrea...@wikimedia.org
Gerrit-Reviewer: Cscott canan...@wikimedia.org
Gerrit-Reviewer: Jforrester jforres...@wikimedia.org
Gerrit-Reviewer: Subramanya Sastry ssas...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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