Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
069f9975
Commit
069f9975
authored
Apr 08, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import was putting the xml data into definition.data.data rather than definition.data
parent
9a405ff4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
common/lib/xmodule/xmodule/modulestore/xml_importer.py
+6
-5
No files found.
common/lib/xmodule/xmodule/modulestore/xml_importer.py
View file @
069f9975
...
...
@@ -284,7 +284,7 @@ def import_from_xml(store, data_dir, course_dirs=None,
except
KeyError
:
# Ignore any missing keys in _model_data
pass
if
'data'
in
content
:
module_data
=
content
[
'data'
]
...
...
@@ -301,16 +301,17 @@ def import_from_xml(store, data_dir, course_dirs=None,
# Note the dropped element closing tag. This causes the LMS to fail when rendering modules - that's
# no good, so we have to do this kludge
if
isinstance
(
module_data
,
str
)
or
isinstance
(
module_data
,
unicode
):
# some module 'data' fields are non strings which blows up the link traversal code
lxml_rewrite_links
(
module_data
,
lambda
link
:
verify_content_links
(
module
,
course_data_path
,
static_content_store
,
link
,
remap_dict
))
lxml_rewrite_links
(
module_data
,
lambda
link
:
verify_content_links
(
module
,
course_data_path
,
static_content_store
,
link
,
remap_dict
))
for
key
in
remap_dict
.
keys
():
module_data
=
module_data
.
replace
(
key
,
remap_dict
[
key
])
except
Exception
,
e
:
except
Exception
:
logging
.
exception
(
"failed to rewrite links on {0}. Continuing..."
.
format
(
module
.
location
))
store
.
update_item
(
module
.
location
,
content
)
store
.
update_item
(
module
.
location
,
module_data
)
if
hasattr
(
module
,
'children'
)
and
module
.
children
!=
[]:
store
.
update_children
(
module
.
location
,
module
.
children
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment