Skip to content

Commit 3d5ef4c

Browse files
authored
fix rename chapter logic
1 parent c630740 commit 3d5ef4c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

command/MigrateCoursewareCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,14 @@ private function createNewCourseware($courseware)
301301
if (count($sections) === 1) {
302302
$section = $sections[0];
303303
$new_section = $this->createStructuralElement($section, $root->id);
304-
$new_subchapter_title =
305-
strval($chapter['title']) === strval($subchapter['title']) ?
306-
$chapter['title'] :
307-
$chapter['title'] . ' - ' . $subchapter['title'];
304+
$new_section_title =
305+
strval($subchapter['title']) === strval($section['title']) ?
306+
$subchapter['title'] :
307+
$subchapter['title'] . ' - ' . $section['title'];
308308
$new_section->title =
309-
strval($new_subchapter_title) === strval($section['title']) ?
310-
$new_subchapter_title :
311-
$new_subchapter_title . ' - ' . $section['title'];
309+
strval($new_section_title) === strval($chapter['title']) ?
310+
$new_section_title :
311+
$chapter['title'] . ' - ' . $new_section_title;
312312
$new_section->position = $chapter['position'];
313313
$new_section->store();
314314
$section_map[$section['id']] = $new_section->id;

0 commit comments

Comments
 (0)