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

tool_customlang silently fails if it cannot write the local lang files

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.6, 3.7
    • Fix Version/s: 3.9
    • Component/s: Language
    • Testing Instructions:
      Hide
      1. Navigate to the data directory for the installation
      2. Reset the lang directory and make it read-only:

        rm -rf lang
        mkdir -p lang
        chmod 444 lang
        

      3. Login as admin
      4. Navigate to Site administration -> Language -> Language customisation
      5. Select a language and customise it
      6. Make a change to one string (e.g. moodle.php core::abouttobeinstalled)
      7. Click 'Save changes to the language pack'
      8. Click "Continue"
        1. Confirm that you get an error like the following:

          error/Unable to write [dataroot]/lang/en_local/moodle.php
          

      Show
      Navigate to the data directory for the installation Reset the lang directory and make it read-only: rm -rf lang mkdir -p lang chmod 444 lang Login as admin Navigate to Site administration -> Language -> Language customisation Select a language and customise it Make a change to one string (e.g. moodle.php core::abouttobeinstalled ) Click 'Save changes to the language pack' Click "Continue" Confirm that you get an error like the following: error/Unable to write [dataroot]/lang/en_local/moodle.php
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:
      MDL-67138-customlang-failures

      Description

      There are a couple reasons they can fail, but most are silently swallowed. A debug call is emitted but you are likely to miss this in prod with the debug level off or low, and an admin typically may not have ready access or interest in trawling the logs. It should display the error front and center.

        Attachments

          Activity

            People

            Assignee:
            brendanheywood Brendan Heywood
            Reporter:
            brendanheywood Brendan Heywood
            Peer reviewer:
            Matt Porritt
            Integrator:
            Andrew Nicols
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            cameron1729, David Mudrák (@mudrd8mz), Helen Foster
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              15/Jun/20

                Time Tracking

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