This commit is contained in:
Sara Arjona 2022-11-10 12:51:24 +01:00
commit ac11386831
2 changed files with 13 additions and 1 deletions

View File

@ -160,6 +160,16 @@ foreach ($langfiles as $lng => $files) {
cli_heading(get_string('clifiles', 'tool_customlang', $lng));
// If we intend to check in any changes, we must first check them out.
if ($checkin) {
cli_writeln(get_string('checkout', 'tool_customlang'));
$progressbar = new progress_bar();
$progressbar->create();
tool_customlang_utils::checkout($lng, $progressbar);
}
foreach ($files as $file) {
// Generate a valid stored_file from this file.
$record = (object)[

View File

@ -89,7 +89,9 @@ class tool_customlang_utils {
* @param progress_bar $progressbar optionally, the given progress bar can be updated
*/
public static function checkout($lang, progress_bar $progressbar = null) {
global $DB;
global $DB, $CFG;
require_once("{$CFG->libdir}/adminlib.php");
// For behat executions we are going to load only a few components in the
// language customisation structures. Using the whole "en" langpack is