-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
2.0, 2.2.7, 2.6.1
-
MOODLE_20_STABLE, MOODLE_22_STABLE, MOODLE_26_STABLE
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.