From 2a35132b2a01d9f4bc828847a2b814f65e8bba4e Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Thu, 15 Nov 2012 21:44:20 -0500 Subject: [PATCH] When importing a course, we need to set the 'display_name' on the static tab module from the course module's policy. This isn't ideal, but the static tab definition on disk does not encapsulate the tab's display name on the LMS - we have to take it from the course --- common/lib/xmodule/xmodule/modulestore/xml.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/lib/xmodule/xmodule/modulestore/xml.py b/common/lib/xmodule/xmodule/modulestore/xml.py index 6794703998..0fe29a3845 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml.py +++ b/common/lib/xmodule/xmodule/modulestore/xml.py @@ -455,6 +455,13 @@ class XMLModuleStore(ModuleStoreBase): slug = os.path.splitext(os.path.basename(filepath))[0] loc = Location('i4x', course_descriptor.location.org, course_descriptor.location.course, category, slug) module = HtmlDescriptor(system, definition={'data' : html}, **{'location' : loc}) + # VS[compat]: + # Hack because we need to pull in the 'display_name' for static tabs (because we need to edit them) + # from the course policy + if category == "static_tab": + for tab in course_descriptor.tabs or []: + if tab.get('url_slug') == slug: + module.metadata['display_name'] = tab['name'] module.metadata['data_dir'] = course_dir self.modules[course_descriptor.id][module.location] = module except Exception, e: