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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8.7, 3.10.1
    • Fix Version/s: 3.9.6, 3.10.3
    • Component/s: HTML and CSS
    • Labels:

      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

            Assignee:
            pholden Paul Holden
            Reporter:
            jpahullo Jordi Pujol-Ahulló
            Peer reviewer:
            Jordi Pujol-Ahulló Jordi Pujol-Ahulló
            Integrator:
            Adrian Greeve Adrian Greeve
            Tester:
            Janelle Barcega Janelle Barcega
            Participants:
            Component watchers:
            Amy Groshek, David Scotson, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              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