diff --git a/src/addon/mod/data/components/action/addon-mod-data-action.html b/src/addon/mod/data/components/action/addon-mod-data-action.html
index 53f5096d7..5645b0c3c 100644
--- a/src/addon/mod/data/components/action/addon-mod-data-action.html
+++ b/src/addon/mod/data/components/action/addon-mod-data-action.html
@@ -28,7 +28,7 @@
{{ entry.timemodified * 1000 | coreFormatDate:"dffulldate" }}
-
+
-{{entry.fullname}}
+{{entry.fullname}}
diff --git a/src/addon/mod/data/pages/edit/edit.ts b/src/addon/mod/data/pages/edit/edit.ts
index 55830538f..3220a679d 100644
--- a/src/addon/mod/data/pages/edit/edit.ts
+++ b/src/addon/mod/data/pages/edit/edit.ts
@@ -253,12 +253,14 @@ export class AddonModDataEditPage {
});
} else {
this.errors = {};
- result.fieldnotifications.forEach((fieldNotif) => {
- const field = this.fieldsArray.find((field) => field.name == fieldNotif.fieldname);
- if (field) {
- this.errors[field.id] = fieldNotif.notification;
- }
- });
+ if (result.fieldnotifications) {
+ result.fieldnotifications.forEach((fieldNotif) => {
+ const field = this.fieldsArray.find((field) => field.name == fieldNotif.fieldname);
+ if (field) {
+ this.errors[field.id] = fieldNotif.notification;
+ }
+ });
+ }
this.jsData['errors'] = this.errors;
setTimeout(() => {
diff --git a/src/addon/mod/data/providers/data.ts b/src/addon/mod/data/providers/data.ts
index 4632f2f36..ca9d5da62 100644
--- a/src/addon/mod/data/providers/data.ts
+++ b/src/addon/mod/data/providers/data.ts
@@ -62,7 +62,7 @@ export class AddonModDataProvider {
.then((entry) => {
return {
// Return provissional entry Id.
- newentryid: entry[1]
+ newentryid: entry
};
});
};
@@ -194,8 +194,9 @@ export class AddonModDataProvider {
});
// App is offline, check required fields.
- fields.forEach((field) => {
- const notification = this.fieldsDelegate.getFieldsNotifications(field, contentsIndexed[field.id]);
+ Object.keys(fields).forEach((key) => {
+ const field = fields[key],
+ notification = this.fieldsDelegate.getFieldsNotifications(field, contentsIndexed[field.id]);
if (notification) {
notifications.push({
fieldname: field.name,