Skip to content

Commit

Permalink
MigrationMoodle: Set access url to course categories - refs BT#15992
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Mar 20, 2020
1 parent 3541936 commit 601e7da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugin/migrationmoodle/src/Loader/CourseCategoriesLoader.php
Expand Up @@ -15,6 +15,8 @@ class CourseCategoriesLoader implements LoaderInterface
/**
* Load the data and return the ID inserted.
*
* @param array $incomingData
*
* @return int
*/
public function load(array $incomingData)
Expand All @@ -26,6 +28,11 @@ public function load(array $incomingData)
$incomingData['parent_id']
);

$tblUrlCategory = \Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE_CATEGORY);
$accessUrlId = \MigrationMoodlePlugin::create()->getAccessUrlId();

\Database::query("UPDATE $tblUrlCategory SET access_url_id = $accessUrlId WHERE course_category_id = $id");

return $id;
}
}

0 comments on commit 601e7da

Please sign in to comment.