UDOIT icon indicating copy to clipboard operation
UDOIT copied to clipboard

File replace fails in Review Files

Open mrash2 opened this issue 3 years ago • 3 comments

When reviewing a course file in UDOIT in a Canvas course, if I drag and drop or select and upload a revised file, I receive conflicting messages. The first says the file was replaced and the second says "File failed to save locally. Please contact an administrator." The second message seems accurate because the file did not get replaced. So it seems we've run into an issue with both the conflicting messaging here and, more importantly, that the files aren't being updated.

The particular files in question are PDFs and I have not tried other file formats. I thought it might be an issue with scopes but verified that all the correct scopes are in place.

Thanks in advance!

image

mrash2 avatar Apr 12 '22 15:04 mrash2

I'm guessing this is a file permissions issue. Verify that your temp directory is set in .env, the directory exists, and has write permissions by PHP.

But we shouldn't be displaying conflicting messages to the user. We need to add a check that no error messages have been added before we add the success message

cidilabs avatar Apr 12 '22 16:04 cidilabs

Thanks all! The lack of temp directory was the problem, so all is well with this issue except the conflicting messages.

mrash2 avatar Apr 13 '22 16:04 mrash2

This issue should be pretty easy to address. Whoever ends up taking this should look at src/Controller/FileItemsController.php and src/Services/LmsPostService.php. The issue is that FileItemsController doesn't check to see if the upload succeeded or not and LmsPostService doesn't really signal whether it worked either.

rob-3 avatar Apr 26 '22 18:04 rob-3