-
Bug
-
Resolution: Done
-
Major
-
3.7.0
-
-
MOODLE_37_STABLE
-
MOODLE_37_STABLE
-
Moodle App 3.7.1
The "core-site-plugins-new-content" documentation describes a "useOtherData" argument that does not work with dynamic field names. The documentation for "Accepting dynamic names in a WebService" describes using something like:
[(ngModel)]="CONTENT_OTHERDATA.data['<% name %>']"
|
for the names of form elements. When this is used, nothing is added to the "args" parameter when something like [useOtherData]="null" is specified to "core-site-plugins-new-content".
if something like
[(ngModel)]="CONTENT_OTHERDATA.<% name %>"
|
is used, then specific items are added to the "args" parameter. But, this structure will not work for passing the values back into the form. The form needs the [(ngModel)]="CONTENT_OTHERDATA.data['<% name %>']" structure.
For example, if this is used:
<ion-textarea aria-multiline="true" [(ngModel)]="CONTENT_OTHERDATA.<%fieldkey%>"
|
core-auto-rows></ion-textarea>
|
then specifying "useOtherData" will load an 'fieldkey' value into the "args" object.
But,
<ion-textarea aria-multiline="true" [(ngModel)]="CONTENT_OTHERDATA.responses['<%fieldkey%>']"
|
core-auto-rows></ion-textarea>
|
will not.
Also, when "otherdata" is passed into the template with text for the text field, the first example will not display any value for the textarea, while the second one will.
To add more confusion, if the argument 'form="myform"' is added, using the first example, no values from the form are returned either with userOtherData or without.