diff --git a/src/addon/mod/choice/providers/sync.ts b/src/addon/mod/choice/providers/sync.ts index 606ffc385..9a14b71d4 100644 --- a/src/addon/mod/choice/providers/sync.ts +++ b/src/addon/mod/choice/providers/sync.ts @@ -43,7 +43,7 @@ export class AddonModChoiceSyncProvider extends CoreCourseActivitySyncBaseProvid protected appProvider: CoreAppProvider, private choiceOffline: AddonModChoiceOfflineProvider, private eventsProvider: CoreEventsProvider, private choiceProvider: AddonModChoiceProvider, translate: TranslateService, private utils: CoreUtilsProvider, protected textUtils: CoreTextUtilsProvider, - courseProvider: CoreCourseProvider, syncProvider: CoreSyncProvider, timeUtils: CoreTimeUtilsProvider, + private courseProvider: CoreCourseProvider, syncProvider: CoreSyncProvider, timeUtils: CoreTimeUtilsProvider, private logHelper: CoreCourseLogHelperProvider, prefetchHandler: AddonModChoicePrefetchHandler, prefetchDelegate: CoreCourseModulePrefetchDelegate) { @@ -200,7 +200,9 @@ export class AddonModChoiceSyncProvider extends CoreCourseActivitySyncBaseProvid }).then(() => { if (courseId) { // Data has been sent to server, prefetch choice if needed. - return this.prefetchAfterUpdate(module, courseId, undefined, siteId).catch(() => { + return this.courseProvider.getModuleBasicInfoByInstance(choiceId, 'choice', siteId).then((module) => { + return this.prefetchAfterUpdate(module, courseId, undefined, siteId); + }).catch(() => { // Ignore errors. }); } diff --git a/src/addon/mod/feedback/providers/sync.ts b/src/addon/mod/feedback/providers/sync.ts index dc447d944..6c6e008a4 100644 --- a/src/addon/mod/feedback/providers/sync.ts +++ b/src/addon/mod/feedback/providers/sync.ts @@ -43,7 +43,7 @@ export class AddonModFeedbackSyncProvider extends CoreCourseActivitySyncBaseProv protected appProvider: CoreAppProvider, private feedbackOffline: AddonModFeedbackOfflineProvider, private eventsProvider: CoreEventsProvider, private feedbackProvider: AddonModFeedbackProvider, protected translate: TranslateService, private utils: CoreUtilsProvider, protected textUtils: CoreTextUtilsProvider, - courseProvider: CoreCourseProvider, syncProvider: CoreSyncProvider, timeUtils: CoreTimeUtilsProvider, + private courseProvider: CoreCourseProvider, syncProvider: CoreSyncProvider, timeUtils: CoreTimeUtilsProvider, private logHelper: CoreCourseLogHelperProvider, prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModFeedbackPrefetchHandler) { @@ -236,7 +236,9 @@ export class AddonModFeedbackSyncProvider extends CoreCourseActivitySyncBaseProv }).then(() => { if (result.updated) { // Data has been sent to server, update data. - return this.prefetchAfterUpdate(module, courseId, undefined, siteId).catch(() => { + return this.courseProvider.getModuleBasicInfoByInstance(feedbackId, 'feedback', siteId).then((module) => { + return this.prefetchAfterUpdate(module, courseId, undefined, siteId); + }).catch(() => { // Ignore errors. }); } diff --git a/src/addon/mod/lesson/providers/lesson-sync.ts b/src/addon/mod/lesson/providers/lesson-sync.ts index d4c183285..907e8f4d3 100644 --- a/src/addon/mod/lesson/providers/lesson-sync.ts +++ b/src/addon/mod/lesson/providers/lesson-sync.ts @@ -91,7 +91,7 @@ export class AddonModLessonSyncProvider extends CoreCourseActivitySyncBaseProvid constructor(loggerProvider: CoreLoggerProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider, syncProvider: CoreSyncProvider, textUtils: CoreTextUtilsProvider, translate: TranslateService, - courseProvider: CoreCourseProvider, private eventsProvider: CoreEventsProvider, + private courseProvider: CoreCourseProvider, private eventsProvider: CoreEventsProvider, private lessonProvider: AddonModLessonProvider, private lessonOfflineProvider: AddonModLessonOfflineProvider, protected prefetchHandler: AddonModLessonPrefetchHandler, timeUtils: CoreTimeUtilsProvider, private utils: CoreUtilsProvider, private urlUtils: CoreUrlUtilsProvider, @@ -431,7 +431,9 @@ export class AddonModLessonSyncProvider extends CoreCourseActivitySyncBaseProvid }).then(() => { if (result.updated && courseId) { // Data has been sent to server, update data. - return this.prefetchAfterUpdate(module, courseId, undefined, siteId).catch(() => { + return this.courseProvider.getModuleBasicInfoByInstance(lessonId, 'lesson', siteId).then((module) => { + return this.prefetchAfterUpdate(module, courseId, undefined, siteId); + }).catch(() => { // Ignore errors. }); } diff --git a/src/addon/mod/survey/providers/sync.ts b/src/addon/mod/survey/providers/sync.ts index 7ade2bb70..d38b0a898 100644 --- a/src/addon/mod/survey/providers/sync.ts +++ b/src/addon/mod/survey/providers/sync.ts @@ -41,7 +41,7 @@ export class AddonModSurveySyncProvider extends CoreCourseActivitySyncBaseProvid constructor(loggerProvider: CoreLoggerProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider, syncProvider: CoreSyncProvider, textUtils: CoreTextUtilsProvider, translate: TranslateService, - courseProvider: CoreCourseProvider, private surveyOffline: AddonModSurveyOfflineProvider, + private courseProvider: CoreCourseProvider, private surveyOffline: AddonModSurveyOfflineProvider, private eventsProvider: CoreEventsProvider, private surveyProvider: AddonModSurveyProvider, private utils: CoreUtilsProvider, timeUtils: CoreTimeUtilsProvider, private logHelper: CoreCourseLogHelperProvider, prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModSurveyPrefetchHandler) { @@ -195,7 +195,9 @@ export class AddonModSurveySyncProvider extends CoreCourseActivitySyncBaseProvid }).then(() => { if (courseId) { // Data has been sent to server, update survey data. - return this.prefetchAfterUpdate(module, courseId, undefined, siteId).catch(() => { + return this.courseProvider.getModuleBasicInfoByInstance(surveyId, 'survey', siteId).then((module) => { + return this.prefetchAfterUpdate(module, courseId, undefined, siteId); + }).catch(() => { // Ignore errors. }); }