Skip to content

Commit

Permalink
Update #14 - #886bwwnb0j - Fix canvas loading/saving
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentcornelis committed Apr 5, 2024
1 parent cca3780 commit a16832c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Types of changes
* **Fixed** for any bug fixes.
* **Security** in case of vulnerabilities.

## Version (4.2.1) - 2024-04-05
- Fixed issue with saving and loading canvas

## Version (4.2.0) - 2024-02-29
- Upgraded and refactored for Moodle 4.2
Expand Down
6 changes: 4 additions & 2 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* @author Luuk Verhoeven
**/

defined('MOODLE_INTERNAL') || die;
require_once(__DIR__ . '/../../config.php');
// Const definitions AJAX_SCRIPT and NO_DUBUG_DISPLAY can't be placed after MOODLE_INTERNAL check. This will result in errors.

/**
* @var bool AJAX_SCRIPT
Expand All @@ -37,6 +36,9 @@
*/
const NO_DEBUG_DISPLAY = true;

require_once(__DIR__ . '/../../config.php');
defined('MOODLE_INTERNAL') || die;

$action = optional_param('action', '', PARAM_TEXT);
$data = (object)optional_param('data', [], PARAM_RAW);

Expand Down
4 changes: 3 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ function gcanvas_pluginfile($course, $cm, $context, $filearea, $args, $forcedown
$fs = get_file_storage();
$relativepath = implode('/', $args);
$fullpath = "/$context->id/mod_gcanvas/$filearea/$itemid/$relativepath";
if (!$file = $fs->get_file_by_hash(sha1($fullpath)) || $file->is_directory()) {

$file = $fs->get_file_by_hash(sha1($fullpath));
if (!$file || $file->is_directory()) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'mod_gcanvas';
$plugin->release = '4.2.0';
$plugin->version = 2024022900;
$plugin->release = '4.2.1';
$plugin->version = 2024040500;
$plugin->requires = 2020061500;
$plugin->supported = [39, 402];
$plugin->maturity = MATURITY_STABLE;

0 comments on commit a16832c

Please sign in to comment.