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

find out a way to send mforms back in ajax requests

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_22_STABLE, MOODLE_26_STABLE

      Description

      I want to ajaxify the Portfolio code to make the UI similar to the file picker but while doing a walkthrough of how this might work with Nico we came across the following problem.

      The portfolio API uses mforms as a standard way for plugins and pieces of moodle that export content to communicate their export-time options.

      The way I imagined the 'ajaxification' to work would be that the js would make xmlhttp requests to a portfolio handler, which would call the same functions in the exporter library as normal, and send back XHTML as the response, which the js would use to replace the contents of the popup div.

      However, in the case of mforms, the XHTML that gets sent back contains javascript, mixed in together. Some of this needs to be executed at the time the popup div is replaced and there's no good way to do this.

      This bug should serve as a dicsussion for how we can find a workaround, because changing the code to not use mforms is really not an option, I think. It's the standard way to make forms in Moodle.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              moodle.com moodle.com
              Reporter:
              mjollnir Penny Leach
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: