diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 121bf98393fd..0591ff0dc4e1 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -75,9 +75,15 @@ def preview_component(request, location): component = modulestore().get_item(location) + component.get_html = wrap_xmodule( + component.get_html, + component, + 'xmodule_edit.html' + ) + return render_to_response('component.html', { 'preview': get_preview_html(request, component, 0), - 'editor': wrap_xmodule(component.get_html, component, 'xmodule_edit.html')(), + 'editor': component.runtime.render(component, None, 'studio_view').content, }) diff --git a/common/lib/xmodule/xmodule/x_module.py b/common/lib/xmodule/xmodule/x_module.py index 310a871b725e..637eb9f17cec 100644 --- a/common/lib/xmodule/xmodule/x_module.py +++ b/common/lib/xmodule/xmodule/x_module.py @@ -812,7 +812,7 @@ def studio_view(self, context): return Fragment(self.get_html()) -class DescriptorSystem(object): +class DescriptorSystem(Runtime): def __init__(self, load_item, resources_fs, error_tracker, **kwargs): """ load_item: Takes a Location and returns an XModuleDescriptor