diff --git a/config.xml b/config.xml
index 53708ab60..fa4497f04 100644
--- a/config.xml
+++ b/config.xml
@@ -64,56 +64,50 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
@@ -123,124 +117,105 @@
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
+
-
+
diff --git a/scripts/langindex.json b/scripts/langindex.json
index 0f4a9586e..2a5ecb26b 100644
--- a/scripts/langindex.json
+++ b/scripts/langindex.json
@@ -1046,6 +1046,7 @@
"addon.notifications.playsound": "local_moodlemobileapp",
"addon.notifications.therearentnotificationsyet": "local_moodlemobileapp",
"addon.storagemanager.deletecourse": "local_moodlemobileapp",
+ "addon.storagemanager.deletecourses": "local_moodlemobileapp",
"addon.storagemanager.deletedatafrom": "local_moodlemobileapp",
"addon.storagemanager.info": "local_moodlemobileapp",
"addon.storagemanager.managestorage": "local_moodlemobileapp",
@@ -1650,6 +1651,7 @@
"core.h5p.editor": "h5p",
"core.h5p.embed": "h5p",
"core.h5p.embedtitle": "h5p",
+ "core.h5p.errorgetemail": "local_moodlemobileapp",
"core.h5p.fullscreen": "h5p",
"core.h5p.gpl": "h5p",
"core.h5p.h5ptitle": "h5p",
@@ -1750,6 +1752,8 @@
"core.login.errorupdatesite": "local_moodlemobileapp",
"core.login.faqcannotconnectanswer": "local_moodlemobileapp",
"core.login.faqcannotconnectquestion": "local_moodlemobileapp",
+ "core.login.faqcannotfindmysiteanswer": "local_moodlemobileapp",
+ "core.login.faqcannotfindmysitequestion": "local_moodlemobileapp",
"core.login.faqsetupsiteanswer": "local_moodlemobileapp",
"core.login.faqsetupsitelinktitle": "local_moodlemobileapp",
"core.login.faqsetupsitequestion": "local_moodlemobileapp",
diff --git a/src/assets/lang/en.json b/src/assets/lang/en.json
index 452621fe6..f56366502 100644
--- a/src/assets/lang/en.json
+++ b/src/assets/lang/en.json
@@ -1651,6 +1651,7 @@
"core.h5p.editor": "Editor",
"core.h5p.embed": "Embed",
"core.h5p.embedtitle": "View the embed code for this content.",
+ "core.h5p.errorgetemail": "Error obtaining the user email. Please check your connection and try again.",
"core.h5p.fullscreen": "Fullscreen",
"core.h5p.gpl": "General Public License v3",
"core.h5p.h5ptitle": "Visit h5p.org to check out more content.",
diff --git a/src/core/h5p/classes/helper.ts b/src/core/h5p/classes/helper.ts
index 30f3807fd..8d42f04c2 100644
--- a/src/core/h5p/classes/helper.ts
+++ b/src/core/h5p/classes/helper.ts
@@ -21,6 +21,7 @@ import { CoreUser } from '@core/user/providers/user';
import { CoreH5P } from '../providers/h5p';
import { CoreH5PCore, CoreH5PDisplayOptions } from './core';
import { FileEntry } from '@ionic-native/file';
+import { Translate } from '@singletons/core.singletons';
/**
* Equivalent to Moodle's H5P helper class.
@@ -94,11 +95,15 @@ export class CoreH5PHelper {
let user;
try {
- user = await CoreUser.instance.getProfile(site.getUserId(), undefined, true);
+ user = await CoreUser.instance.getProfile(site.getUserId(), undefined, false, siteId);
} catch (error) {
// Ignore errors.
}
+ if (!user || !user.email) {
+ throw Translate.instance.instant('core.h5p.errorgetemail');
+ }
+
const basePath = CoreFile.instance.getBasePathInstant();
const ajaxPaths = {
xAPIResult: '',
@@ -118,7 +123,7 @@ export class CoreH5PHelper {
l10n: {
H5P: CoreH5P.instance.h5pCore.getLocalization(),
},
- user: {name: site.getInfo().fullname, mail: user && user.email},
+ user: {name: site.getInfo().fullname, mail: user.email},
hubIsEnabled: false,
reportingIsEnabled: false,
crossorigin: null,
diff --git a/src/core/h5p/lang/en.json b/src/core/h5p/lang/en.json
index d661721f0..f30e70de0 100644
--- a/src/core/h5p/lang/en.json
+++ b/src/core/h5p/lang/en.json
@@ -39,6 +39,7 @@
"editor": "Editor",
"embed": "Embed",
"embedtitle": "View the embed code for this content.",
+ "errorgetemail": "Error obtaining the user email. Please check your connection and try again.",
"fullscreen": "Fullscreen",
"gpl": "General Public License v3",
"h5ptitle": "Visit h5p.org to check out more content.",