-
Bug
-
Resolution: Fixed
-
Minor
-
2.3, 3.4
-
MOODLE_23_STABLE, MOODLE_34_STABLE
-
MOODLE_33_STABLE, MOODLE_34_STABLE
-
MDL-33886-master -
Moodle generates an exception when the user enters a really long filename as the name of a backup file. The filename column in mdl_files is varchar (255). If you exceed 255 characters, the exception generated is not handled by Moodle. A generic error is produced that, unless debug is turned on, doesn't tell the user what is broken.
I sincerely doubt this is a regression bug caused by any 2.3 changes!!
To recreate:
Pre-requisites:
- An existing course with plenty of data.
Test Steps:
- Backup the course and enter more than 255 characters as the filename of the backup.
Expected result:
- Moodle gracefully informs the user that the filename is too long.
Actual result:
- Moodle generates the following error:
Can not create file "31/backup/course/0///123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-12.mbz"
More information about this error
Debug info: Data too long for column 'filename' at row 1
INSERT INTO mdl_files (contextid,component,filearea,itemid,filepath,filename,timecreated,timemodified,mimetype,userid,source,author,license,status,sortorder,filesize,contenthash,pathnamehash) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => '31',
1 => 'backup',
2 => 'course',
3 => 0,
4 => '/',
5 => '123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-12.mbz',
6 => 1340177941,
7 => 1340177941,
8 => 'application/vnd.moodle.backup',
9 => '2',
10 => NULL,
11 => NULL,
12 => NULL,
13 => 0,
14 => 0,
15 => 1254809,
16 => 'dae2ae7ef894d6cdc517264f7a77fa0464c81e56',
17 => 'd13cd587ebdd3bfcd10e02dbf7d2067039103df0',
)]
Error code: storedfilenotcreated
Stack trace:
line 1049 of /lib/filestorage/file_storage.php: stored_file_creation_exception thrown
line 313 of /backup/util/helper/backup_helper.class.php: call to file_storage->create_file_from_pathname()
line 1595 of /backup/moodle2/backup_stepslib.php: call to backup_helper::store_backup_file()
line 34 of /backup/util/plan/backup_execution_step.class.php: call to backup_store_backup_file->define_execution()
line 153 of /backup/util/plan/base_task.class.php: call to backup_execution_step->execute()
line 146 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
line 110 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()
line 309 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()
line 111 of /backup/util/ui/backup_ui.class.php: call to backup_controller->execute_plan()
line 89 of /backup/backup.php: call to backup_ui->execute()
- Discovered while testing
-
MDLQA-3912 CLONE - Moodle 2.3 QA Cycle 2 Test Session 3
- Passed
- has a non-specific relationship to
-
MDL-61723 Courses with long "shortname" can't backup anymore
- Closed