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

Incorrect validation workshop form if decimal separator is ',' for example spanish international

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.1
    • Forms Library, Workshop
    • None
    • MOODLE_31_STABLE

      When changing to a language whith a comma like decimal separator (example: English to Spanish), I get an error messing when the form validatesthe following fields:
      'submission grade to pass'
      'assestment grade to pass'

      I've traced back the source code and I've detected that the issue comes from the script formslib.php which generates validation functions with incorrect regular expressions, when the language is set up with the comma as decimal separator (which is the case of the Spanish language, in opposite to English which uses '.'):

      var regex = /(?\d\d*\.\d*$)|(?\d\d*$)|(^-?*.\d\d$) /;

      According to the Spanish setup, the correct expression should be

      var regex = /(?\d\d**,\d$)|(?\d\d*$)|(^-?*,\d\d$)/; (whith comma , not point)

            Unassigned Unassigned
            randion randion
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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