To reproduce:
- Go to "Site administration > Advanced features"
- Tick "Enable portfolios"
- Click "Save changes"
- Go to "Site administration > Plugins > Portfolios > Manage portfolios"
- Make "File download" "Enabled and visible"
- Go to a course with a forum discussion.
- Post a reply to that discussion.
- After posting your reply, click on the "Export to portfolio" link.
- Select any of the "Available export formats"
- Click "Next"
- Click "Continue" to confirm the file export.
- Check the contents of the downloaded file.
- Expected
- The downloaded file should contain the appropriate content.
- Actual
- The downloaded file contains the following error message (e.g. in HTML format):
<br />
<b>Fatal error</b>: stored_file::readfile(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "file_system_filedir" of the object you are trying to operate on was loaded before unserialize() gets called or provide a __autoload() function to load the class definition in <b>/home/jun/moodles/stable_master/moodle/lib/filestorage/stored_file.php</b> on line <b>385</b><br />
- The downloaded file contains the following error message (e.g. in HTML format):