gjbarnard / moodle-format_grid

Grid course format contributed by Gareth J Barnard originally created by Paul Krix
GNU General Public License v3.0
21 stars 55 forks source link

Fatal upgrade error if section image could not be found in filestorage #146

Closed PM84 closed 3 years ago

PM84 commented 3 years ago

If a file can be found in the DB, but for whatever reason it cannot be found in the filestorage, the following error is currently thrown during an upgrade:

`-->format_grid PHP Warning: copy(/srv/shared/moodle-dlb/moodledata/filedir/a1/10/a1104606c11ea0c78dd28df724197d8779e44754): failed to open stream: No such file or directory in /srv/shared/moodle-dlb/html/lib/filestorage/file_system_filedir.php on line 234 PHP Warning: getimagesize(/srv/shared/moodle-dlb/moodledata/temp/gridformatdisplayedimagecontainer/a1104606c11ea0c78dd28df724197d8779e44754): failed to open stream: No such file or directory in /srv/shared/moodle-dlb/html/course/format/grid/classes/toolbox.php on line 1013 PHP Warning: unlink(/srv/shared/moodle-dlb/moodledata/temp/gridformatdisplayedimagecontainer/a1104606c11ea0c78dd28df724197d8779e44754): No such file or directory in /srv/shared/moodle-dlb/html/course/format/grid/classes/toolbox.php on line 1016 Database transaction aborted automatically in /srv/shared/moodle-dlb/html/admin/cli/upgrade.php Default exception handler: Fehlende Bildinformation - itemid > 19930, filename > goi_Zeichenfläche 1 Kopie.png, sectionimage_sectionid > 19930, sectionimage_image > goi_Zeichenfläche 1 Kopie.png, sectionimage_newimage > goi_Zeichenfläche 1 Kopie.png and sectionimage_displayedimageindex > 1. Melden Sie bitte die Fehlerdetails und die Information aus der Datei php.log dem Entwickler. Debug: generate_image Error code: noimageinformation

!!! Fehlende Bildinformation - itemid > 19930, filename > goi_Zeichenfläche 1 Kopie.png, sectionimage_sectionid > 19930, sectionimage_image > goi_Zeichenfläche 1 Kopie.png, sectionimage_newimage > goi_Zeichenfläche 1 Kopie.png and sectionimage_displayedimageindex > 1. Melden Sie bitte die Fehlerdetails und die Information aus der Datei php.log dem Entwickler. !!! !! generate_image Error code: noimageinformation !! !! Stack trace: * line 498 of /lib/setuplib.php: moodle_exception thrown

A possible Solution is the pull request: #147

gjb2048 commented 3 years ago

@PM84 Thanks for the info and patch, but I've already solved this in #143.