From f1d6014304e93d1e80c97141852357cf7b67714a Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 25 Jun 2021 11:49:12 +0200 Subject: [PATCH 1/2] MOBILE-3320 cordova: Use new branch for inappbrowser plugin --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 122168ca7..8436c7567 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8078,7 +8078,7 @@ }, "cordova-plugin-inappbrowser": { "version": "git+https://github.com/moodlemobile/cordova-plugin-inappbrowser.git#a1ac936fd79596fd5841bd424cc782ee84e4a290", - "from": "git+https://github.com/moodlemobile/cordova-plugin-inappbrowser.git#moodle" + "from": "git+https://github.com/moodlemobile/cordova-plugin-inappbrowser.git#moodle-ionic5" }, "cordova-plugin-ionic-keyboard": { "version": "2.2.0", diff --git a/package.json b/package.json index 2bd9413d3..899750288 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "cordova-plugin-file-transfer": "git+https://github.com/moodlemobile/cordova-plugin-file-transfer.git", "cordova-plugin-geolocation": "4.1.0", "cordova-plugin-globalization": "1.11.0", - "cordova-plugin-inappbrowser": "git+https://github.com/moodlemobile/cordova-plugin-inappbrowser.git#moodle", + "cordova-plugin-inappbrowser": "git+https://github.com/moodlemobile/cordova-plugin-inappbrowser.git#moodle-ionic5", "cordova-plugin-ionic-keyboard": "2.2.0", "cordova-plugin-ionic-webview": "5.0.0", "cordova-plugin-local-notification": "git+https://github.com/moodlemobile/cordova-plugin-local-notification.git#moodle", From 331fd9fef91f29ecb383e61694c6d28f7b1faaf4 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 28 Jun 2021 13:22:29 +0200 Subject: [PATCH 2/2] MOBILE-3320 assign: Fix leave confirm displayed when shouldn't --- .../assign/feedback/comments/component/comments.ts | 2 +- .../mod/assign/feedback/comments/services/handler.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/addons/mod/assign/feedback/comments/component/comments.ts b/src/addons/mod/assign/feedback/comments/component/comments.ts index 371d82140..12cfc7579 100644 --- a/src/addons/mod/assign/feedback/comments/component/comments.ts +++ b/src/addons/mod/assign/feedback/comments/component/comments.ts @@ -93,7 +93,7 @@ export class AddonModAssignFeedbackCommentsComponent extends AddonModAssignFeedb // Update the text and save it as draft. this.isSent = false; - this.text = this.replacePluginfileUrls(text); + this.text = this.replacePluginfileUrls(text || ''); AddonModAssignFeedbackDelegate.saveFeedbackDraft(this.assign.id, this.userId, this.plugin, { text: text, format: 1, diff --git a/src/addons/mod/assign/feedback/comments/services/handler.ts b/src/addons/mod/assign/feedback/comments/services/handler.ts index 0e0a3b4ce..1b288988c 100644 --- a/src/addons/mod/assign/feedback/comments/services/handler.ts +++ b/src/addons/mod/assign/feedback/comments/services/handler.ts @@ -49,13 +49,14 @@ export class AddonModAssignFeedbackCommentsHandlerService implements AddonModAss * @param inputData Data entered in the feedback edit form. * @return Text to submit. */ - getTextFromInputData(plugin: AddonModAssignPlugin, inputData: AddonModAssignFeedbackCommentsTextData): string { + getTextFromInputData(plugin: AddonModAssignPlugin, inputData: AddonModAssignFeedbackCommentsTextData): string | undefined { + if (inputData.assignfeedbackcomments_editor === undefined) { + return undefined; + } + const files = plugin.fileareas && plugin.fileareas[0] ? plugin.fileareas[0].files : []; - // The input data can have a string or an object with text and format. Get the text. - const text = inputData.assignfeedbackcomments_editor || ''; - - return CoreTextUtils.restorePluginfileUrls(text, files || []); + return CoreTextUtils.restorePluginfileUrls(inputData.assignfeedbackcomments_editor, files || []); } /**