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

    • 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

              pholden Paul Holden
              itamart Itamar Tzadok
              Frédéric Massart Frédéric Massart
              Sam Hemelryk Sam Hemelryk
              Andrew Lyons Andrew Lyons
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              6 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Jan/15