This is the same problem that we had in MDL-52486. When the language
pack with multiple underscores (such as "en_us_k12") is selected, the
html root element's "lang" attribute is set to
<html lang="en-us-12" ...>
which we then map back to the Moodle lang code using the JS function
replace().
What was missed in MDL-52486 was that when replacing a value (and not a
regular expression), only the first instance of the value is replaced.
So the value "en_us-k12" was sent as the lang parameter for the
core_string, which is invalid PARAM_LANG value and the exception was
thrown.
In case of the user_date.js, there was no actual problem experienced and
probably there is none as the language code is used as a cache key
rather than a PARAM_LANG parameter. But we are changing it too for
consistency.
Recently we added support to the new OAuth SSO methods (Google,
Facebook, Microsoft) and identity providers, that will require
launchurl to be returned always by tool_mobile_get_public_config
It is safe to return always the launchurl, the main reason to not
return it was to reduce data returned by Web Services when was not
required.
The module was choosing as incorrect the first possible incorrect
answer instead the first student incorrect answer.
In the patch I also refactored the foreach loop to avoid code
duplication.
The variables AJAX_SCIRPT, CLI_SCRIPT, WS_SERVER are always defined (and set to false)
when webpages are rendered, hence the check of 'defined' is invalid
MDL-58267 converted "Display description on course page" to advcheckbox
(see 7f53e8aa22d555ba5f94530b7fc04a4e95f35c98).
Advanced checkboxes cannot be tested without real browser because Goutte
does not support the hidden+checkbox duality (MDL-55386).
So this patch does:
- Convert the NON-JS checks to use the "Force format" field (normal checkbox).
- Move the "Display description on course page" (adv. checkbox) to the JS scenario.
- Complete the 2 groups of checks above so the two ways to tick and untick are covered:
- I set the field "xxxx" to "yyyy"
- I set the following fields to these values:
- Complete the 2 groups of checks above so the two ways to verify the values are covered:
- the field "xxxx" [matches|does not match] value "yyyy"
- the following fields [match|do not match] these values:
That's all! The scenario is a bit spaghetti but it's way off the scope
of the issue to fix that.
As per core_completion\manager::get_available_completion_tabs() the
required capability for this feature is moodle/course:manageactivities,
not moodle/course:update.