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

The get_format_string has a wrong parameters list

XMLWordPrintable

    • HQ 2024 Sprint I1.3 Moppies

      The get_format_string is a format-based method that extends the functionality of the original get_string method.

      However, when the function was introduced in MDL-76851, the param list was copied wrong and use string $lang as the third param instead of a boolean $lazyload.

      The main problem with the $lazyload is that it changes the method return type, which is not needed for format strings. In this case, the best approach is to remove that parameter altogether.

      The good news is that the 4th param is not used anywhere and will throw an error if someone tries to use it.  It can be removed without hesitation and there is no need for any formal deprecation process.

      This is a screenshot of a VScode showing the error:

            tusefomal Ferran Recio
            tusefomal Ferran Recio
            Carlos Escobedo Carlos Escobedo
            Huong Nguyen Huong Nguyen
            Huong Nguyen Huong Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.