Bsitu has uploaded a new change for review.

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

Change subject: JS load of topic with garbled post breaks board interactivity
......................................................................

JS load of topic with garbled post breaks board interactivity

Haven't tested this but this should work, :)

Bug: 61097
Change-Id: If838e853f46fad724acf42f83b8c810509cb8edb
---
M modules/new/components/flow-board.js
1 file changed, 13 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/74/155474/1

diff --git a/modules/new/components/flow-board.js 
b/modules/new/components/flow-board.js
index a845a47..3e8aca8 100644
--- a/modules/new/components/flow-board.js
+++ b/modules/new/components/flow-board.js
@@ -425,13 +425,19 @@
                                return;
                        }
 
-                       // Render topiclist template
-                       $target.before(
-                               $tmp = $( 
flowBoard.TemplateEngine.processTemplateGetFragment(
-                                       'flow_topiclist_loop',
-                                       data.flow[ 'view-topiclist' 
].result.topiclist
-                               ) ).children()
-                       );
+                       // See bug 61097, Catch any random javascript error from
+                       // parsoid so they don't break and stop the page
+                       try {
+                               // Render topiclist template
+                               $target.before(
+                                       $tmp = $( 
flowBoard.TemplateEngine.processTemplateGetFragment(
+                                               'flow_topiclist_loop',
+                                               data.flow[ 'view-topiclist' 
].result.topiclist
+                                       ) ).children()
+                               );
+                       } catch( e ) {
+                               // nothing to do, just silently ignore the 
external error
+                       }
                        // Run loadHandlers
                        FlowBoardComponent.UI.makeContentInteractive( $tmp );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If838e853f46fad724acf42f83b8c810509cb8edb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>

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

Reply via email to