Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49008

Lang packs can be lost when using the update installed language packs scheduled task

XMLWordPrintable

    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-49008_lang_vanish
    • Hide

      go to site admin > languages > language packs and install a language like cs.

      Go into your dataroot and find lang/cs/cs.md5. Open it in a text editor and change the value in the file.

      Click "update all installed language packs" on the language pack admin page (site admin > languages > language packs). The update should proceed and the cs language pack should be updated.

      Again, alter the contents of cs.md5.

      Run the language update scheduled task with the following command.

      php admin/tool/task/cli/schedule_task.php --execute=\\tool_langimport\\task
      update_langpacks_task

      Run the lang import behat tests

      vendor/bin/behat --config /path/to/your/behat/dataroot/directory/behat/behat.yml --tags @tool_langimport

      For these to work you need to define TOOL_LANGIMPORT_REMOTE_TESTS in your config.php.

      Show
      go to site admin > languages > language packs and install a language like cs. Go into your dataroot and find lang/cs/cs.md5. Open it in a text editor and change the value in the file. Click "update all installed language packs" on the language pack admin page (site admin > languages > language packs). The update should proceed and the cs language pack should be updated. Again, alter the contents of cs.md5. Run the language update scheduled task with the following command. php admin/tool/task/cli/schedule_task.php --execute=\\tool_langimport\\task update_langpacks_task Run the lang import behat tests vendor/bin/behat --config /path/to/your/behat/dataroot/directory/behat/behat.yml --tags @tool_langimport For these to work you need to define TOOL_LANGIMPORT_REMOTE_TESTS in your config.php.

      As noticed on moodle.org (MDLSITE-3775), lang packs can be lost if there is a problem connecting to download.moodle.org when the update installed language packs scheduled task is running (also when attempting to update all installed lang packs via the UI).

      Steps to reproduce as suggested by stronk7:

      1) install a good number of languages in your test site.
      2) In this line, add a sleep of around 5 minutes: sleep(300) ==> https://github.com/moodle/moodle/blob/ed914e31c518c164b1dcbeee2df6b7d57468620f/admin/tool/langimport/classes/controller.php#L148
      3) run the scheduled task in charge of updating the langs
      4) after 30 seconds with the task running, disconnect your computer from internet
      5) after 4:30 minutes (aprox) the process will end
      6) expected results: all languages are still there, current result: all languages have been deleted

      this should be as simple as replacing current deletion of current language being processed with a temp copy that 1) should be reused if the installation failed or 2) should be deleted if the installation ended ok.

            andyjdavis Andrew Davis
            tsala Helen Foster
            Dan Poltawski Dan Poltawski
            Andrew Lyons Andrew Lyons
            Damyon Wiese Damyon Wiese
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.