Skip to content

Conversation

@taniwallach
Copy link
Member

In listCourses test also for the existence of the course_user table and ignore directories for which there is no such table.

I chose the course_user table, 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-statistics misbehaves 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.

…nd ignore directories for which there is no such table.
Copy link
Member

@mgage mgage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks clear and good. I'll pull and test it later today.

@mgage mgage self-requested a review July 6, 2021 17:21
Copy link
Member

@mgage mgage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worked well for me. I introduced a few empty directories and they did not appear in the list. There was no noticeable speed hit. The empty directories also did not appear in the admin view of courses

Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good. I tested it quickly, and it works as promised.

@drgrice1 drgrice1 merged commit 1b3bd3b into openwebwork:WeBWorK-2.16 Jul 7, 2021
drgrice1 pushed a commit that referenced this pull request Jul 7, 2021
…nd ignore directories for which there is no such table. (#1434)
@taniwallach taniwallach deleted the list-courses-check-for-user-table branch July 8, 2021 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants