From 15f4856f81255a106c721730487614ddc71f6b2c Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 26 Jan 2022 14:21:13 +0100 Subject: [PATCH] MOBILE-3833 core: Fix detect 3.4 or older sites --- src/core/classes/site.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/classes/site.ts b/src/core/classes/site.ts index b6f17c472..8989abfde 100644 --- a/src/core/classes/site.ts +++ b/src/core/classes/site.ts @@ -576,9 +576,13 @@ export class CoreSite { // Call the WS. try { - // Send the language to use. Do it after checking cache to prevent losing offline data when changing language. - data.moodlewssettinglang = preSets.lang ?? await CoreLang.getCurrentLanguage(); - data.moodlewssettinglang = data.moodlewssettinglang.replace('-', '_'); // Moodle uses underscore instead of dash. + if (method !== 'core_webservice_get_site_info') { + // Send the language to use. Do it after checking cache to prevent losing offline data when changing language. + // Don't send it to core_webservice_get_site_info, that WS is used to check if Moodle version is supported. + data.moodlewssettinglang = preSets.lang ?? await CoreLang.getCurrentLanguage(); + // Moodle uses underscore instead of dash. + data.moodlewssettinglang = data.moodlewssettinglang.replace('-', '_'); + } const response = await this.callOrEnqueueRequest(method, data, preSets, wsPreSets);