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

Javascript error in form client side validation script when the form class is namespaced

    XMLWordPrintable

    Details

    • Sprint:
      BACKEND Sprint 18

      Description

      The validation script generated by MoodleQuickForm::getValidationScript() uses the form name in the javascript function name. The form name is generated by moodleform::get_form_identifier() as the class name. With namespaced classes the form name may contain backslashes, as in

      mod_dataform\pluginbase\entriesform

      but javascript doesn't like it and fails.

      MoodleQuickForm::getValidationScript() should make sure the form name is javascript valid and escape if needed.

      Workaround: Override moodleform::get_form_identifier() in your namespaced form class to return an identifier without the backslashes.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pholden Paul Holden
              Reporter:
              itamart Itamar Tzadok
              Peer reviewer:
              Frédéric Massart
              Integrator:
              Sam Hemelryk
              Tester:
              Andrew Nicols
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              6 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Jan/15