I have exactly the same problem. I couldn't find a single example using filemanager in a block that is correct... Even found a block, submitted to Moodle plugins directory, with this same problem.
The problem is that: The files uploaded by a user are only visible to this same user.
I followed the example here: https://github.com/AndyNormore/filemanager (very helpful) and tryed to adapt it to a block with no success (on the edit by different users part). The problem seems to be loading the files to the new user draftarea.
edit_form.php
function set_data($defaults) {
....
$itemid = 0;
$draftitemid = file_get_submitted_draft_itemid('config_attachments');
file_prepare_draft_area($draftitemid, $context->id, 'block_partnerships', 'content', $itemid, $filemanageropts);
$defaults->config_attachments = $draftitemid;
parent::set_data($defaults);
}
The $draftitemid gets the new generated number and the draft files (and real files) are created in the mdl_files table correctly (i think).
I could not understand why files added by a user are not loaded to other users draftarea... Shouldn't this be accomplished by:
$defaults->config_attachments = $draftitemid;
What am I missing? Some help here... please
Thank you,
susana