This started out as an endeavour to fix that folder structure creation sometimes fails. We succeeded at that, and fixed some more things along the way...
In the error message, explicitly communicate which folder could not be created.
Save one roundtrip to find out the user name of the system account (Moodle stored that already).
Fix folder creation error: We need to clean for PARAM_FILE, not PARAM_PATH (slashes in name parts are problematic).
This is WIP; remaining work:
[ ] If a file has been shared with the system account account: Don't fail, continue!
[x] Check system account connectivity before using it (see TODO).
[x] Simplify $result array in create_folder_path_access_controlled_links.
This started out as an endeavour to fix that folder structure creation sometimes fails. We succeeded at that, and fixed some more things along the way...
PARAM_FILE
, notPARAM_PATH
(slashes in name parts are problematic).This is WIP; remaining work:
$result
array increate_folder_path_access_controlled_links
.