File tree Expand file tree Collapse file tree
cms/djangoapps/contentstore/views Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020from xblock .exceptions import NoSuchHandlerError
2121from xblock .plugin import PluginMissingError
2222from xblock .runtime import Mixologist
23+ from xmodule .x_module import XModuleMixin
2324
2425from common .djangoapps .edxmako .shortcuts import render_to_response
2526from common .djangoapps .student .auth import has_course_author_access
@@ -132,7 +133,11 @@ def _load_mixed_class(category):
132133 return None
133134
134135 component_class = XBlock .load_class (category )
135- mixologist = Mixologist (settings .XBLOCK_MIXINS )
136+ mixins = settings .XBLOCK_MIXINS
137+ class_with_path_name = f"{ component_class .__module__ } .{ component_class .__name__ } "
138+ if class_with_path_name in getattr (settings , "STANDARD_COMPLIANT_XBLOCKS" , ()):
139+ mixins = tuple (m for m in mixins if m is not XModuleMixin )
140+ mixologist = Mixologist (mixins )
136141 return mixologist .mix (component_class )
137142
138143
Original file line number Diff line number Diff line change @@ -2030,6 +2030,20 @@ def add_optional_apps(optional_apps, installed_apps):
20302030 EditInfoMixin ,
20312031)
20322032
2033+ # .. setting_name: STANDARD_COMPLIANT_XBLOCKS
2034+ # .. setting_default: ()
2035+ # .. setting_description: Tuple of fully-qualified XBlock class names that conform to the standard XBlock
2036+ # interface. For these XBlocks, the platform will not inject legacy mixins like XModuleMixin when
2037+ # instantiating them via the various XBlock runtimes.
2038+ STANDARD_COMPLIANT_XBLOCKS = (
2039+ "xblocks_contrib.video.video.VideoBlock" ,
2040+ "xblocks_contrib.word_cloud.word_cloud.WordCloudBlock" ,
2041+ "xblocks_contrib.discussion.discussion.DiscussionXBlock" ,
2042+ "xblocks_contrib.poll.poll.PollBlock" ,
2043+ "xblocks_contrib.html.html.HtmlBlockMixin" ,
2044+ "xblocks_contrib.annotatable.annotatable.AnnotatableBlock" ,
2045+ )
2046+
20332047######################## Built-in Blocks Extraction ########################
20342048
20352049# The following Django settings flags have been introduced temporarily to facilitate
You can’t perform that action at this time.
0 commit comments