Merge pull request #2049 from crazyserver/MOBILE-3068

MOBILE-3025 blocks: Limit block usage to 3.7 onwards
main
Juan Leyva 2019-08-07 12:57:01 +02:00 committed by GitHub
commit 9ea37af4c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -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<any[]>} Promise resolved with the list of blocks.
* @since 3.3
* @since 3.7
*/
getCourseBlocks(courseId: number, siteId?: string): Promise<any[]> {
return this.sitesProvider.getSite(siteId).then((site) => {