From e5f5f31a10bf1ad2c802ecf057a1f1a853e7b822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 7 Aug 2019 12:32:36 +0200 Subject: [PATCH] MOBILE-3025 blocks: Limit block usage to 3.7 onwards --- src/core/course/providers/course.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/course/providers/course.ts b/src/core/course/providers/course.ts index 9ddb17e59..f812ef2b6 100644 --- a/src/core/course/providers/course.ts +++ b/src/core/course/providers/course.ts @@ -114,10 +114,11 @@ export class CoreCourseProvider { * Check if the get course blocks WS is available in current site. * * @return {boolean} Whether it's available. - * @since 3.3 + * @since 3.7 */ canGetCourseBlocks(): boolean { - return this.sitesProvider.wsAvailableInCurrentSite('core_block_get_course_blocks'); + return this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.7') && + this.sitesProvider.wsAvailableInCurrentSite('core_block_get_course_blocks'); } /** @@ -267,7 +268,7 @@ export class CoreCourseProvider { * @param {number} courseId Course ID. * @param {string} [siteId] Site ID. If not defined, current site. * @return {Promise} Promise resolved with the list of blocks. - * @since 3.3 + * @since 3.7 */ getCourseBlocks(courseId: number, siteId?: string): Promise { return this.sitesProvider.getSite(siteId).then((site) => {