Skip to content

Commit c212187

Browse files
authored
SAK-51178 msgcntr discussion topic console error for GB by groups (#13510)
1 parent 58d08aa commit c212187

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

msgcntr/messageforums-app/src/webapp/jsp/dfReviseForumSettingsAttach.jsp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141
</script>
4242
<script>
4343
$(document).ready(function() {
44-
window.syncGbSelectorInput("gb-selector", "revise:forum_assignments");
44+
var isGradebookGroupEnabled = '<%= isGradebookGroupEnabled %>';
45+
var forumGradingExists = document.getElementById("forum_grading") !== null;
46+
if (isGradebookGroupEnabled === 'true' && forumGradingExists) {
47+
window.syncGbSelectorInput("gb-selector", "revise:forum_assignments");
48+
}
4549
4650
const radioButtonRestrictedAvailability = document.getElementById('revise:availabilityRestricted:1');
4751
if (radioButtonRestrictedAvailability.checked && $(".calWidget")[0].style['display'] === 'none') {

msgcntr/messageforums-app/src/webapp/jsp/dfReviseTopicSettingsAttach.jsp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@
378378
<h:outputText styleClass="sak-banner-info" value="#{msgs.group_sitegradebook_simple_forum}" />
379379
</h:panelGroup>
380380
381-
<h:panelGrid columns="2" rendered="#{ForumTool.gradebookExist && !ForumTool.selectedForum.markForDeletion && not ForumTool.discussionGeneric}" style="margin-top:.5em;clear:both" styleClass="itemSummary">
381+
<h:panelGrid columns="2" rendered="#{ForumTool.gradebookExist && !ForumTool.selectedForum.markForDeletion && not ForumTool.discussionGeneric}" style="margin-top:.5em;clear:both" styleClass="itemSummary" id="topic_grading">
382382
<h:panelGroup style="white-space:nowrap;">
383383
<h:outputLabel for="topic_assignments" value="#{msgs.perm_choose_assignment}"></h:outputLabel>
384384
</h:panelGroup>
@@ -512,7 +512,11 @@
512512
</h:form>
513513
<script>
514514
$(document).ready(function () {
515-
window.syncGbSelectorInput("gb-selector", "revise:topic_assignments");
515+
var isGradebookGroupEnabled = '<%= isGradebookGroupEnabled %>';
516+
var topicGradingExists = document.getElementById("topic_grading") !== null;
517+
if (isGradebookGroupEnabled === 'true' && topicGradingExists) {
518+
window.syncGbSelectorInput("gb-selector", "revise:forum_assignments");
519+
}
516520
517521
$('.displayMore').click(function(e) {
518522

msgcntr/messageforums-app/src/webapp/jsp/discussionForum/message/dfMsgGrade.jsp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@
9898

9999
<script>
100100
$(document).ready(function() {
101-
window.syncGbSelectorInput("gb-selector", "msgForum:gb_selector");
101+
if ('<%= isGradebookGroupEnabled %>' == 'true') {
102+
window.syncGbSelectorInput("gb-selector", "msgForum:gb_selector");
103+
}
102104
103105
try {
104106
var sakaiReminder = new SakaiReminder();

msgcntr/messageforums-app/src/webapp/jsp/discussionForum/statistics/dfStatisticsListByTopic.jsp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@
195195
sakaiReminder.new($(this).val());
196196
});
197197
});
198-
initGbSelector("gb-selector", "dfStatisticsForm:gb_selector");
198+
199+
if (document.getElementById("multigradebook-group-container") !== null) {
200+
window.syncGbSelectorInput("gb-selector", "revise:forum_assignments");
201+
}
199202
200203
});
201204
</script>

0 commit comments

Comments
 (0)