Mooeypoo has uploaded a new change for review.

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

Change subject: [wip] Fix flow DM in single-view and history pages
......................................................................

[wip] Fix flow DM in single-view and history pages

Make sure topic history doesn't have a flow-board component, so
flow-initialize can escape its operations.

Also add a sanity check to dm.System's populateBoardTopicsFromJson
roots array so even if we ever fall onto a page with a separate
and different API response the DM at least doesn't explode.

Bug: T106750
Change-Id: I4b817e5b7b3e3c507fc3583328ffae0628fb9920
---
M handlebars/flow_block_topic_history.handlebars
M modules/flow/dm/mw.flow.dm.System.js
2 files changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/handlebars/flow_block_topic_history.handlebars 
b/handlebars/flow_block_topic_history.handlebars
index e1bcf07..ef2efd7 100644
--- a/handlebars/flow_block_topic_history.handlebars
+++ b/handlebars/flow_block_topic_history.handlebars
@@ -1,4 +1,4 @@
-<div class="flow-board">
+<div class="flow-board-history">
        {{> flow_errors}}
 
        <div class="flow-topic-histories">
diff --git a/modules/flow/dm/mw.flow.dm.System.js 
b/modules/flow/dm/mw.flow.dm.System.js
index 283140f..d438ed8 100644
--- a/modules/flow/dm/mw.flow.dm.System.js
+++ b/modules/flow/dm/mw.flow.dm.System.js
@@ -206,6 +206,11 @@
                        updateTimestampsByTopicId = {},
                        topics = [];
 
+               if ( !$.isPlainObject( topiclist ) ) {
+                       return;
+               }
+               topiclist.roots = topiclist.roots || [];
+
                for ( i = 0, len = topiclist.roots.length; i < len; i++ ) {
                        // The content of the topic is its first post
                        topicId = topiclist.roots[ i ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b817e5b7b3e3c507fc3583328ffae0628fb9920
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <mor...@gmail.com>

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

Reply via email to