Skip to content

Commit

Permalink
Don't fail on image upload #199.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Jan 19, 2024
1 parent ba0c468 commit 2ba77a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions form/sectionfilemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public function validateSubmitValue($value) {
$toolbox = \format_grid\toolbox::get_instance();
try {
$toolbox->setup_displayed_image($sectionimage, $file, $course->id, $sectionid, $format);
} catch (\moodle_exception $me) {
if (!defined('BEHAT_SITE_RUNNING')) {
$lock->release();
}
$failure = $me->getMessage();
} catch (\Exception $e) {
if (!defined('BEHAT_SITE_RUNNING')) {
$lock->release();
Expand Down
2 changes: 1 addition & 1 deletion lang/en/format_grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
$string['originalheightempty'] = 'Original height is empty - {$a}';
$string['originalwidthempty'] = 'Original width is empty - {$a}';
$string['noimageinformation'] = 'Image information is empty - {$a}';
$string['reporterror'] = 'Please use the error details and the information contained in the php.log to understand the nature of why the uploaded image cannot be used';
$string['reporterror'] = 'Please use the error information to understand the nature of why the uploaded image cannot be used';

// Privacy.
$string['privacy:nop'] = 'The Grid format stores lots of settings that pertain to its configuration. None of the settings are related to a specific user. It is your responsibilty to ensure that no user data is entered in any of the free text fields. Setting a setting will result in that action being logged within the core Moodle logging system against the user whom changed it, this is outside of the formats control, please see the core logging system for privacy compliance for this. When uploading images, you should avoid uploading images with embedded location data (EXIF GPS) included or other such personal data. It would be possible to extract any location / personal data from the images. Please examine the code carefully to be sure that it complies with your interpretation of your privacy laws. I am not a lawyer and my analysis is based on my interpretation. If you have any doubt then remove the format forthwith.';

0 comments on commit 2ba77a0

Please sign in to comment.