We were having an intermittent issue relating to uploading files to our moodle courses. Sometimes, our faculty would upload a document as an attachment to a forum post, or embeded in a Text label, and they would get an incredibly unhelpful error from php complaining that a variable was undefined. Then they would lose all of their edits and uploads.
After turning debugging all the way up, we got the following:
To fix this, we moved the declaration of $filescontenthash = []; up a level from line 166 to line 162.
After doing that, no error occurred and all edits and file uploads are saved.
We were having an intermittent issue relating to uploading files to our moodle courses. Sometimes, our faculty would upload a document as an attachment to a forum post, or embeded in a Text label, and they would get an incredibly unhelpful error from php complaining that a variable was undefined. Then they would lose all of their edits and uploads.
After turning debugging all the way up, we got the following:
To fix this, we moved the declaration of $filescontenthash = []; up a level from line 166 to line 162.
After doing that, no error occurred and all edits and file uploads are saved.