Skip to content

Commit

Permalink
fix: allow importing courses into Studio with empty libraries (#574)
Browse files Browse the repository at this point in the history
If a content library xblock does not specify a library id, we
previously would error out when importing, due to some cleanup
code that wasn't accounting for this case.

Co-authored-by: Michael Terry <[email protected]>
  • Loading branch information
mfarhan943 and mikix authored Aug 6, 2024
1 parent 42c400b commit 0c3a237
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/lib/xmodule/xmodule/modulestore/xml_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ def _convert_ref_fields_to_new_namespace(reference):
if block.location.block_type == 'library_content':
# If library exists, update source_library_version and children
# according to this existing library and library content block.
if store.get_library(block.source_library_key):
if block.source_library_id and store.get_library(block.source_library_key):
# If the library content block is already in the course, then don't
# refresh the children when we re-import it. This lets us address
# TNL-7507 (Randomized Content Block Settings Lost in Course Import)
Expand Down

0 comments on commit 0c3a237

Please sign in to comment.