mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
adf336cbf2
This 'fix' is basically a work-around, but one that is already used in some places. Now it is used in all similar places. Exactly what causes the current file path in a file manager to become unset is still unclear to me, but it seems to be an obscure race condition that is very hard to reproduce. However, when it happens, currently we are effectively defaulting to path '/undefined/'. Using '/' is never worse, and is infinitely better in the case where the filepicker does not allow folders to be used (which includes important cases like essay questions in a quiz, which some people use for exams!). In that case, falling back to non-top-level path leads to dataloss. Also, this is all historic JavaScript which will get replaced in the grand de-YUI-fication, so I think a pragmatic fix is justified here.