Modify listCourses to also test for the existence of the course_user table #1434
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In
listCoursestest also for the existence of thecourse_usertable and ignore directories for which there is no such table.I chose the
course_usertable, as that is one whose absence will quickly cause problems.This is intended to address the issue that the current code would assume that any subdirectory in the courses directory corresponded to a "real" course.
That issue also was mentioned in #1424 as
bin/update-OPL-statisticsmisbehaves where there are subdirectories which do not correspond to courses. Several other parts of the code-base will have similar various problems handling incorrect names from the old code.For example, until this PR, the code which generates the list of courses for the "home page" at "/webwork2" on the server could include links for names of subdirectories which are not valid courses.