diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py
index 8ba35628c2..93f0c9c6cf 100644
--- a/cms/djangoapps/contentstore/views/course.py
+++ b/cms/djangoapps/contentstore/views/course.py
@@ -423,7 +423,7 @@ def course_index(request, course_key):
"""
# A depth of None implies the whole course. The course outline needs this in order to compute has_changes.
# A unit may not have a draft version, but one of its components could, and hence the unit itself has changes.
- with modulestore().bulk_operations(course_key):
+ with modulestore().bulk_temp_noop_operations(course_key): # FIXME
course_module = _get_course_module(course_key, request.user, depth=None)
lms_link = get_lms_link_for_item(course_module.location)
sections = course_module.get_children()
diff --git a/common/lib/xmodule/xmodule/modulestore/__init__.py b/common/lib/xmodule/xmodule/modulestore/__init__.py
index 2bacbd6814..01b370d62c 100644
--- a/common/lib/xmodule/xmodule/modulestore/__init__.py
+++ b/common/lib/xmodule/xmodule/modulestore/__init__.py
@@ -566,6 +566,14 @@ class ModuleStoreReadBase(ModuleStoreRead):
finally:
self._end_bulk_operation(course_id)
+ @contextmanager
+ def bulk_temp_noop_operations(self, course_id):
+ """
+ A hotfix noop b/c old mongo does not properly handle nested bulk operations and does unnecessary work
+ if the bulk operation only reads data. Replace with bulk_operations once fixed (or don't merge to master)
+ """
+ yield
+
def _begin_bulk_operation(self, course_id):
"""
Begin a bulk write operation on course_id.
diff --git a/common/lib/xmodule/xmodule/modulestore/search.py b/common/lib/xmodule/xmodule/modulestore/search.py
index 8854aa1865..43fe6878b9 100644
--- a/common/lib/xmodule/xmodule/modulestore/search.py
+++ b/common/lib/xmodule/xmodule/modulestore/search.py
@@ -68,7 +68,8 @@ def path_to_location(modulestore, usage_key):
newpath = (next_usage, path)
queue.append((parent, newpath))
- with modulestore.bulk_operations(usage_key.course_key):
+ # FIXME replace with bulk_operations once it's fixed for old mongo
+ with modulestore.bulk_temp_noop_operations(usage_key.course_key):
if not modulestore.has_item(usage_key):
raise ItemNotFoundError(usage_key)
diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
index 2d6fbebdcc..ecdfb0dcd2 100644
--- a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
@@ -901,7 +901,7 @@ class TestMixedModuleStore(unittest.TestCase):
# TODO: LMS-11220: Document why draft send count is 5
# TODO: LMS-11220: Document why draft find count is [19, 6]
# TODO: LMS-11220: Document why split find count is [2, 2]
- @ddt.data(('draft', [21, 6], 0), ('split', [2, 2], 0))
+ @ddt.data(('draft', [18, 5], 0), ('split', [16, 6], 0)) # FIXME, replace w/ above when bulk reenabled
@ddt.unpack
def test_path_to_location(self, default_ms, num_finds, num_sends):
"""
diff --git a/common/static/coffee/spec/discussion/view/discussion_thread_view_spec.coffee b/common/static/coffee/spec/discussion/view/discussion_thread_view_spec.coffee
index a3d76aa5a4..84512cd4e9 100644
--- a/common/static/coffee/spec/discussion/view/discussion_thread_view_spec.coffee
+++ b/common/static/coffee/spec/discussion/view/discussion_thread_view_spec.coffee
@@ -124,6 +124,32 @@ describe "DiscussionThreadView", ->
expect($(".post-body").text()).toEqual(expectedAbbreviation)
expect(DiscussionThreadShowView.prototype.convertMath).toHaveBeenCalled()
+ it "strips script tags appropriately", ->
+ DiscussionViewSpecHelper.setNextResponseContent({resp_total: 0, children: []})
+ longMaliciousBody = new Array(100).join("\n")
+ @thread.set("body", longMaliciousBody)
+ maliciousAbbreviation = DiscussionUtil.abbreviateString(@thread.get('body'), 140)
+
+ # The nodes' html should be different than the strings, but
+ # their texts should be the same, indicating that they've been
+ # properly escaped. To be safe, make sure the string "