From f8e24fcf46285c7b6471d68542b7147534f6eede Mon Sep 17 00:00:00 2001
From: Thomas Marstrander <marstranderthomas@gmail.com>
Date: Mon, 12 Dec 2022 12:50:18 +0100
Subject: [PATCH] Fix folder path issues with new core

Prepare for release 1.23
---
 classes/file_storage.php | 9 +++++++--
 version.php              | 4 ++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/classes/file_storage.php b/classes/file_storage.php
index 1578371..7e7c68f 100644
--- a/classes/file_storage.php
+++ b/classes/file_storage.php
@@ -54,7 +54,7 @@ class file_storage implements \H5PFileStorage {
             'component' => 'mod_hvp',
             'filearea' => 'libraries',
             'itemid' => 0,
-            'filepath' => '/' . \H5PCore::libraryToString($library, true) . '/',
+            'filepath' => '/' . \H5PCore::libraryToFolderName($library) . '/',
         );
 
         // Remove any old existing library files.
@@ -148,7 +148,7 @@ class file_storage implements \H5PFileStorage {
      */
     // @codingStandardsIgnoreLine
     public function exportLibrary($library, $target) {
-        $folder = \H5PCore::libraryToString($library, true);
+        $folder = \H5PCore::libraryToFolderName($library);
         $context = \context_system::instance();
         self::exportFileTree("{$target}/{$folder}", $context->id, 'libraries', "/{$folder}/");
     }
@@ -882,4 +882,9 @@ class file_storage implements \H5PFileStorage {
         // Store in local storage folder.
         return file_put_contents($filepath, $stream);
     }
+
+    // @codingStandardIgnoreLine
+    public function deleteLibrary($library) {
+        // TODO: Implement deleteLibrary() method.
+    }
 }
diff --git a/version.php b/version.php
index c00ed40..709953d 100644
--- a/version.php
+++ b/version.php
@@ -23,9 +23,9 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2022012000;
+$plugin->version   = 2022121200;
 $plugin->requires  = 2013051403;
 $plugin->cron      = 0;
 $plugin->component = 'mod_hvp';
 $plugin->maturity  = MATURITY_STABLE;
-$plugin->release   = '1.22.4';
+$plugin->release   = '1.23.0';
-- 
GitLab