Affects Version/s: 3.6
Fix Version/s: None
When downloading submissions from an assignment while using the Japanese language pack, submission files with file names in Japanese are either missing from the package or lack a file name.
The key variables to replicate this issue:
- Submitted file must have a file name in Japanese.
- Submissions must be downloaded while using Japanese language pack (ja) rather than English.
- Download submissions in folders option must be selected.
STEPS TO REPLICATE
- Go to Site administration > Language > Language Packs. If not already installed, install the Japanese language pack (ja).
- Go to Site administration > Language > Language settings. If Languages on language menu is not blank, add ja to the list.
- Create a course and create an assignment.
- Enroll a user as a student in the course.
- Login as the student and upload two files, one in English and one in Japanese こんにちは.docx
- As admin/teacher, access assignment "View all submissions" page.
- Ensure 'Download submissions in folders' option is selected.
- Change your 'Preferred language' to Japanese (ja) (dropdown in bottom right of footer if using Snap or via Preferences if using a core theme).
- Selection submission checkbox on left hand side of submission.
- Click on With selected>Download selected submission (In Japanese this is the third option in the list '選択した提出をダウンロードする') and click "Go"
- Click "OK" on popup (Submission should now be downloaded),
- Extract contents of zip and open the folder to find submission.
Windows 7/10 - For the Japanese file, the submission's file name is blank and only the extension type displays. The English file is fine.
Mac OSX - There is no submission file present in the folder (only tested with Japanese file).
Windows 7/10 - Submission file name is present
Mac OSX - Submission file is present
The fix was to set a locale because basename is locale aware (https://www.php.net/manual/en/function.basename.php), this fixes the problem with Japanese language and should not affect any other language.