Skip to content

Commit 0a8d609

Browse files
committed
MOBILE-1986 forum: Show All Parts only if MDL bug fixed
1 parent cce82e3 commit 0a8d609

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

www/addons/mod/forum/controllers/newdiscussion.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ angular.module('mm.addons.mod_forum')
193193
function addAllParticipantsOption(groups, check) {
194194
var promise;
195195

196-
if (check) {
196+
if (!$mmaModForum.isAllParticipantsFixed()) {
197+
// All participants has a bug, don't add it.
198+
return $q.when(groups);
199+
} else if (check) {
197200
// We need to check if the user can add a discussion to all participants.
198201
promise = $mmaModForum.canAddDiscussionToAll(forumId).catch(function() {
199202
// The call failed, let's assume he can't.

www/addons/mod/forum/services/forum.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,18 @@ angular.module('mm.addons.mod_forum')
267267
return undefined;
268268
};
269269

270+
/**
271+
* There was a bug adding new discussions to All Participants (see MDL-57962). Check if it's fixed.
272+
*
273+
* @module mm.addons.mod_forum
274+
* @ngdoc method
275+
* @name $mmaModForum#isAllParticipantsFixed
276+
* @return {Boolean} True if fixed, false otherwise.
277+
*/
278+
self.isAllParticipantsFixed = function() {
279+
return $mmSite.isVersionGreaterEqualThan(['3.1.5', '3.2.2']);
280+
};
281+
270282
/**
271283
* Check if canAddDiscussion is available.
272284
*

0 commit comments

Comments
 (0)