Skip to content

Conversation

drgrice1
Copy link
Member

If one of the course links that are now maintained by webwork points to a location inside a non existent directory, then the realpath calls in lib/WeBWorK/Utils/CourseDirectoryIntegrityCheck.pm throw exceptions. This occurs both when checking for course upgrades and when upgrading courses. So those calls are wrapped in evals to prevent the exceptions.

I have identified this as the cause of the issue discussed in https://forums.openwebwork.org/mod/forum/discuss.php?d=8757#p22321.

To test this delete the Contrib link in a course's templates directory, and create a bad link with something like

sudo ln -s /bad/location /opt/webwork/courses/courseId/templates/Contrib

Then go to the "Upgrade Courses" page in the admin course. It will give an error with the current develop or main branches. With this pull request it will show that the link structure of the course needs repair. Furthermore, repairing the link will work.

If one of the course links that are now maintained by webwork points to
a location inside a non existent directory, then the `realpath` calls in
`lib/WeBWorK/Utils/CourseDirectoryIntegrityCheck.pm` throw exceptions.
This occurs both when checking for course upgrades and when upgrading
courses.  So those calls are wrapped in evals to prevent the exceptions.

I have identified this as the cause of the issue discussed in
https://forums.openwebwork.org/mod/forum/discuss.php?d=8757#p22321.

To test this delete the Contrib link in a course's templates directory,
and create a bad link with something like

```bash
sudo ln -s /bad/location /opt/webwork/courses/courseId/templates/Contrib
```

Then go to the "Upgrade Courses" page in the admin course.  It will give
an error with the current develop or main branches.  With this pull
request it will show that the link structure of the course needs repair.
Furthermore, repairing the link will work.
@Alex-Jordan Alex-Jordan merged commit 91e2017 into openwebwork:main Aug 20, 2025
2 checks passed
@drgrice1 drgrice1 deleted the directory-integrity-realpath-fix-hotfix branch August 20, 2025 19:31
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.

3 participants