FileManager error

FileManager error

by Peter de Jong -
Number of replies: 6

After installing Moodle for the first time, I get the following error on the first page after installation (which is my User account):

Exception - Argument 1 passed to file_get_all_files_in_draftarea() must be of the type integer, null given, called in [dirroot]/lib/form/filemanager.php on line 336

Also, did something go wrong in the installation? It looks very different from what I expected. I thought Moodle would look more like Totara (I only have experience with Totara). Please see the attached screenshot. The main page looks more like a "User Dashboard" than an actual LMS. I'm a bit confused. It feels like something was not installed.

Attachment Screen Shot 2018-08-01 at 13.16.07.png
Average of ratings: -
In reply to Peter de Jong

Re: FileManager error

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I haven't seen that error before - I suspect maybe a permissions issue somewhere.  However, that is how Moodle looks out of the box.  Go to Site Administration to set up...

In reply to Emma Richardson

Re: FileManager error

by Peter de Jong -

Thank you for the reply.

I haven't seen the error since. I don't have to worry about it? smile

In reply to Emma Richardson

Re: FileManager error

by Paul Martin -

I'm actually seeing the same thing on v3.5.1.  Whenever someone tries to change the course format, or tries to change a setting within the course format, we get the following error:

[15-Aug-2018 08:58:30 America/Detroit] Default exception handler: Exception - Argument 1 passed to file_get_all_files_in_draftarea() must be of the type integer, null given, called in [dirroot]/lib/form/filemanager.php on line 336 Debug:

Error code: generalexceptionmessage

* line 767 of /lib/filelib.php: TypeError thrown

* line 336 of /lib/form/filemanager.php: call to file_get_all_files_in_draftarea()

* line 580 of /lib/formslib.php: call to MoodleQuickForm_filemanager->validateSubmitValue()

* line 526 of /lib/formslib.php: call to moodleform->validate_defined_fields()

* line 636 of /lib/formslib.php: call to moodleform->is_validated()

* line 153 of /course/edit.php: call to moodleform->get_data()

This only happens with instructors, not with admins.  I agree that it feels like a permissions issue but that seems weird as I never had it happen with v3.3 (which we just upgraded from) and frankly, I don't even know what permissions to check.  Any thoughts?

In reply to Paul Martin

Re: FileManager error

by Paul Martin -

Ok, after some more troubleshooting, I've sussed out what the issue is and yes, it's a permissions issue (at least for me).  We had previously set the "moodle/course:changesummary" to "Prohibit" because of an issue we had with instructors changing things they shouldn't be changing.  Turns out that when I toggled this back to "Allow" then the error goes away.


This is new behavior - should I open a bug tracker issue for this?  

Average of ratings: Useful (1)
In reply to Paul Martin

Re: FileManager error

by Bob Derezinski -

I am an Administrator I receive the same error.

Even stranger is the other person who is also an Administrator is able to edit and save changes without error.

We have also followed the steps in the reported bug by changing the Change Course Summary setting on the Teacher role and we are still unable to edit and save changes, nor are we able to add new SCORM activites, we get the same error. We are on 3.5.1