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

tool_customlang CLI import misses initial language pack checkout

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 3.11.11, 4.0.5
    • 3.11.10, 4.0.4
    • Language
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • Hide

      Testing requires a fresh site

      1. Download customlang-export-en.zip and note it's path
      2. From CLI run the following command:

        $ php admin/tool/customlang/cli/import.php --lang=en --source=<PATHTOFILE> --checkin --mode=all
        

      3. Confirm you see the following message:

        == Files to import into en ==
        Open language pack for editing
        [ <PROGRESSBAR> ]
        Loading language pack
        

      4. Wait for progress bar/checkout to complete (note it is slow only the first time this action is performed either via CLI/UI)
      5. Confirm you see the following message:

        == Import files string (mode all) ==
        String core_access/accesshelp updated successfully.
        Save changes to the language pack
        

      6. Log in as admin
      7. Navigate to Language > Language customisation in site administration
      8. Choose English (en)
      9. Press Open language pack for editing
      10. Under Show strings of these components select access.php and press Show strings
      11. Confirm Local customisation for the core_access/accesshelp string contains "Something something something"
      Show
      Testing requires a fresh site Download customlang-export-en.zip and note it's path From CLI run the following command: $ php admin/tool/customlang/cli/import.php --lang=en --source=<PATHTOFILE> --checkin --mode=all Confirm you see the following message: == Files to import into en == Open language pack for editing [ <PROGRESSBAR> ] Loading language pack Wait for progress bar/checkout to complete (note it is slow only the first time this action is performed either via CLI/UI) Confirm you see the following message: == Import files string (mode all) == String core_access/accesshelp updated successfully. Save changes to the language pack Log in as admin Navigate to Language > Language customisation in site administration Choose English (en) Press Open language pack for editing Under Show strings of these components select access.php and press Show strings Confirm Local customisation for the core_access/accesshelp string contains "Something something something"

    Description

      Prerequisites:

      • In a running Moodle instance, customize the "core_admin/sitemaintenancetitle" language string of the english language pack within the language customization GUI.
      • Open your terminal and run this command:

        php admin/tool/customlang/cli/export.php --lang=en --target=/tmp/en_local
        

      • Afterwards, there is a zip file at /tmp/en_local[[exportzipfilename]] (which is a bug reported at MDL-75970, just to be precise here). Rename this file to /tmp/en_local.zip for further procedure.

      Steps to reproduce:

      • Get a fresh Moodle installation where you are sure that nobody has made any language customizations yet.
      • In your terminal, run this command in this fresh Moodle installation:

        php admin/tool/customlang/cli/import.php --lang=en --source=/tmp/en_local.zip --checkin --mode=all
        

      Expected result:

      • In your terminal, you should see this output:

        == Files to import into en ==
        /tmp/en_local.zip 
         
        == Import files string (mode all) ==
        String core_admin/sitemaintenancetitle updated successfully.
        Save changes to the language pack
        

      • The modified string takes effect in the Moodle GUI.

      Actual result:

      • In your terminal, you see this output:

        == Files to import into en ==
        /tmp/en_local.zip 
         
        == Import files string (mode all) ==
        Missing component core_admin.
        Save changes to the language pack
        

      • The modified string does not take effect in the Moodle GUI.

      Analysis:

      • The CLI import tool seems not to do the initial language pack checkout which is necessary before the first language string customization.
      • In the GUI, if you go to Site administration -> Language -> Language customization -> Pick "English", this initial checkout happens automatically before you can use the customization GUI for the first time. As a workaround for this issue, you can do the initial checkout in the GUI and run the CLI importer afterwards.

      Attachments

        1. MDL-75974_master_1.png
          33 kB
          Angelia Dela Cruz
        2. MDL-75974_master_2.png
          50 kB
          Angelia Dela Cruz
        3. MDL-75974_master_3.png
          86 kB
          Angelia Dela Cruz
        4. MDL-75974_v311_1.png
          34 kB
          Angelia Dela Cruz
        5. MDL-75974_v311_2.png
          51 kB
          Angelia Dela Cruz
        6. MDL-75974_v311_3.png
          93 kB
          Angelia Dela Cruz
        7. MDL-75974_v400_1.png
          35 kB
          Angelia Dela Cruz
        8. MDL-75974_v400_2.png
          50 kB
          Angelia Dela Cruz
        9. MDL-75974_v400_3.png
          83 kB
          Angelia Dela Cruz
        10. result_1.png
          215 kB
          Huong Nguyen
        11. result_2.png
          240 kB
          Huong Nguyen
        12. result_3.png
          134 kB
          Huong Nguyen

        Issue Links

          Activity

            People

              pholden Paul Holden
              abias Alexander Bias
              Alexander Bias Alexander Bias
              Huong Nguyen Huong Nguyen
              Angelia Dela Cruz Angelia Dela Cruz
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 20 minutes
                  1h 20m

                  Clockify

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