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

JavaScript core/str can wrongfully cache parameters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8
    • Fix Version/s: 3.8.1
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide
      1. Download teststr.php to your Moodle instance's root folder.
      2. Disable the "cachejs" admin setting. (If you're using MDK, simply do "mdk run undev")
      3. Open "teststr.php" on your browser
      4. Confirm that all of the "Actual" and "expected" string values are the same.
      5. Enable "cachejs" (On MDK: "mdk run mindev")
      6. Refresh the "teststr.php" page.
      7. Confirm that all of the "Actual" and "expected" string values remain the same.
      Show
      Download teststr.php to your Moodle instance's root folder. Disable the " cachejs " admin setting. (If you're using MDK, simply do " mdk run undev ") Open " teststr.php " on your browser Confirm that all of the " Actual " and " expected " string values are the same. Enable " cachejs " (On MDK: " mdk run mindev ") Refresh the " teststr.php " page. Confirm that all of the " Actual " and " expected " string values remain the same.
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull 3.8 Branch:
    • Pull Master Branch:
      MDL-67434-master

      Description

      The JavaScript core/str::get_strings() function can wrongfully cache the promise parameters when it lacks cache and multiple calls to get_string are made within a short time.

      I believe that this issue would mostly only happen during development, or prior to language strings being cached in the browser.

      See attached file for replication steps.

        Attachments

        1. image-2019-12-11-09-21-45-242.png
          80 kB
          Janelle Barcega
        2. teststr.php
          0.9 kB
          Frédéric Massart

          Activity

            People

            Assignee:
            fred Frédéric Massart
            Reporter:
            fred Frédéric Massart
            Peer reviewer:
            Jun Pataleta
            Integrator:
            Andrew Nicols
            Tester:
            Janelle Barcega
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Jan/20

                Time Tracking

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