diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index d597221dec08..02cdb2a38381 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -409,8 +409,7 @@ def __init__(self, *args, **kwargs): log.error(msg) continue - # TODO check that this is still needed here and can't be by defaults. - if self.tabs is None: + if not self.tabs: # When calling the various _tab methods, can omit the 'type':'blah' from the # first arg, since that's only used for dispatch tabs = [] diff --git a/common/lib/xmodule/xmodule/video_module.py b/common/lib/xmodule/xmodule/video_module.py index 5354297c2ba6..1d9ad35135be 100644 --- a/common/lib/xmodule/xmodule/video_module.py +++ b/common/lib/xmodule/xmodule/video_module.py @@ -125,7 +125,7 @@ def from_xml(cls, xml_data, system, org=None, course=None): url identifiers """ video = super(VideoDescriptor, cls).from_xml(xml_data, system, org, course) - _parse_video_xml(video, xml_data) + _parse_video_xml(video, video.data) return video def definition_to_xml(self, resource_fs): @@ -146,10 +146,6 @@ def _parse_video_xml(video, xml_data): display_name = xml.get('display_name') if display_name: video.display_name = display_name - elif video.url_name is not None: - # copies the logic of display_name_with_default in order that studio created videos will have an - # initial non guid name - video.display_name = video.url_name.replace('_', ' ') youtube = xml.get('youtube') if youtube: diff --git a/common/lib/xmodule/xmodule/xml_module.py b/common/lib/xmodule/xmodule/xml_module.py index 882e308c77d3..5b8d2c8aee0c 100644 --- a/common/lib/xmodule/xmodule/xml_module.py +++ b/common/lib/xmodule/xmodule/xml_module.py @@ -306,6 +306,7 @@ def from_xml(cls, xml_data, system, org=None, course=None): org and course are optional strings that will be used in the generated modules url identifiers """ + xml_object = etree.fromstring(xml_data) # VS[compat] -- just have the url_name lookup, once translation is done url_name = xml_object.get('url_name', xml_object.get('slug')) @@ -318,7 +319,8 @@ def from_xml(cls, xml_data, system, org=None, course=None): filepath = cls._format_filepath(xml_object.tag, name_to_pathname(url_name)) definition_xml = cls.load_file(filepath, system.resources_fs, location) else: - definition_xml = xml_object # this is just a pointer, not the real definition content + definition_xml = xml_object + filepath = None definition, children = cls.load_definition(definition_xml, system, location) # note this removes metadata diff --git a/common/test/data/toy/chapter/secret/magic.xml b/common/test/data/toy/chapter/secret/magic.xml index 62756b889630..f85d2e75dad1 100644 --- a/common/test/data/toy/chapter/secret/magic.xml +++ b/common/test/data/toy/chapter/secret/magic.xml @@ -1,3 +1,3 @@ - diff --git a/common/test/data/toy/course/2012_Fall.xml b/common/test/data/toy/course/2012_Fall.xml index c3500040c273..8f0125ef2d0f 100644 --- a/common/test/data/toy/course/2012_Fall.xml +++ b/common/test/data/toy/course/2012_Fall.xml @@ -3,10 +3,10 @@ - - diff --git a/common/test/data/toy/vertical/vertical_test.xml b/common/test/data/toy/vertical/vertical_test.xml index e801a4ac8606..68c5745f371d 100644 --- a/common/test/data/toy/vertical/vertical_test.xml +++ b/common/test/data/toy/vertical/vertical_test.xml @@ -1,4 +1,6 @@ +