Merge pull request #2851 from dpalou/MOBILE-3320

Mobile 3320
main
Noel De Martin 2021-06-28 16:47:24 +02:00 committed by GitHub
commit 8028899ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 8 deletions

2
package-lock.json generated
View File

@ -8078,7 +8078,7 @@
}, },
"cordova-plugin-inappbrowser": { "cordova-plugin-inappbrowser": {
"version": "git+https://github.com/moodlemobile/cordova-plugin-inappbrowser.git#a1ac936fd79596fd5841bd424cc782ee84e4a290", "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": { "cordova-plugin-ionic-keyboard": {
"version": "2.2.0", "version": "2.2.0",

View File

@ -96,7 +96,7 @@
"cordova-plugin-file-transfer": "git+https://github.com/moodlemobile/cordova-plugin-file-transfer.git", "cordova-plugin-file-transfer": "git+https://github.com/moodlemobile/cordova-plugin-file-transfer.git",
"cordova-plugin-geolocation": "4.1.0", "cordova-plugin-geolocation": "4.1.0",
"cordova-plugin-globalization": "1.11.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-keyboard": "2.2.0",
"cordova-plugin-ionic-webview": "5.0.0", "cordova-plugin-ionic-webview": "5.0.0",
"cordova-plugin-local-notification": "git+https://github.com/moodlemobile/cordova-plugin-local-notification.git#moodle", "cordova-plugin-local-notification": "git+https://github.com/moodlemobile/cordova-plugin-local-notification.git#moodle",

View File

@ -93,7 +93,7 @@ export class AddonModAssignFeedbackCommentsComponent extends AddonModAssignFeedb
// Update the text and save it as draft. // Update the text and save it as draft.
this.isSent = false; this.isSent = false;
this.text = this.replacePluginfileUrls(text); this.text = this.replacePluginfileUrls(text || '');
AddonModAssignFeedbackDelegate.saveFeedbackDraft(this.assign.id, this.userId, this.plugin, { AddonModAssignFeedbackDelegate.saveFeedbackDraft(this.assign.id, this.userId, this.plugin, {
text: text, text: text,
format: 1, format: 1,

View File

@ -49,13 +49,14 @@ export class AddonModAssignFeedbackCommentsHandlerService implements AddonModAss
* @param inputData Data entered in the feedback edit form. * @param inputData Data entered in the feedback edit form.
* @return Text to submit. * @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 : []; 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. return CoreTextUtils.restorePluginfileUrls(inputData.assignfeedbackcomments_editor, files || []);
const text = inputData.assignfeedbackcomments_editor || '';
return CoreTextUtils.restorePluginfileUrls(text, files || []);
} }
/** /**