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

new lang_string('a', 'b', 0) != get_string('a', 'b', 0)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.8.7, 3.10.1
    • 3.9.6, 3.10.3
    • HTML and CSS

    Description

        1. Context

      I discovered this misbehaviour working on a settings.php, where I need to use an admin_setting_description to show some parameterized string. I suppose it will work the same way in other parts of the Moodle.

        1. Scenario

      Supose the string 'a' of the component 'b' is of the form "{$a}<br/>Some kind description".

        1. What works properly

      get_string('a', 'b', 0) returns a string like "0<br/>Some kind description", replacing the given value inside the string.

        1. What doesn't work

      new lang_string('a', 'b', 0) return a string like '{$a}<br/>Some kind description", without replacing the given value inside the string.

      I do not know if any other cases with similar behaviour may produce similar side effects (like working with booleans or empty strings or so).

       

      Attachments

        Activity

          People

            pholden Paul Holden
            jpahullo Jordi Pujol-Ahulló
            Jordi Pujol-Ahulló Jordi Pujol-Ahulló
            Adrian Greeve Adrian Greeve
            Janelle Barcega Janelle Barcega
            Amy Groshek, David Scotson, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              25/Mar/21

              Time Tracking

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