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

Improve the way how get_region_name() method check for string existence

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.10, 3.11, 4.0
    • Fix Version/s: 3.11
    • Component/s: Blocks, Language, Themes
    • Labels:

      Description

      At the moment, the theme_config::get_region_name() checks if the first character of the get_string() is a square bracket to interpret it as whether the string exists or not.

      This is not right, even if it works.

      • The fact that non-existing strings are returned in certain format starting with the bracket, is kind of side debugging effect. The value is really undefined and should not be relied upon.
      • The string could actually exist and be worded so that its first character is also the square bracket.

      There is a string API method string_exists() that should be used instead.

        Attachments

        1. MDL-70486.jpg
          17 kB
          Anna Carissa Sadia

          Activity

            People

            Assignee:
            mudrd8mz David Mudrák (@mudrd8mz)
            Reporter:
            mudrd8mz David Mudrák (@mudrd8mz)
            Peer reviewer:
            Peter Dias Peter Dias
            Integrator:
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Tester:
            Anna Carissa Sadia Anna Carissa Sadia
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, David Mudrák (@mudrd8mz), Helen Foster, Víctor Déniz Falcón, Huong Nguyen, Bas Brands, Mathew May
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

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