Skip to content

Commit

Permalink
Update submitty_student_auto_feed.php
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
pbailie committed Oct 5, 2023
1 parent 9857f16 commit 512cbce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

8 changes: 4 additions & 4 deletions student_auto_feed/submitty_student_auto_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ private function invalidate_courses() {
*
* @see CRN_COPYMAP_FILE located in config.php
* @see db::get_course_list() located in ssaf_db.php
* @return array copymap array, or empty array on copymap file open failure.
* @return array copymap array, or empty array when copymap disabled or copymap file open failure.
*/
private function read_crn_copymap() {
// Skip this function when CRN_COPYMAP_FILE is null
if (is_null(CRN_COPYMAP_FILE)) return true;
// Skip this function and return empty copymap array when CRN_COPYMAP_FILE is null
if (is_null(CRN_COPYMAP_FILE)) return array();

// Insert "_{$this->semester}" right before file extension.
// e.g. When term is "f23", "/path/to/copymap.csv" becomes "/path/to/copymap_f23.csv"
Expand Down Expand Up @@ -456,7 +456,7 @@ private function read_crn_copymap() {
*/
private function process_crn_copymap() {
// Skip when there is no crn copymap data. i.e. There are no courses being duplicated.
if (empty($this->crn_copymap)) return true;
if (is_null(CRN_COPYMAP_FILE) || empty($this->crn_copymap)) return true;

foreach($this->data as $course=>$course_data) {
// Is the course being duplicated?
Expand Down

0 comments on commit 512cbce

Please sign in to comment.