MOBiLE-2795 data: Fix saving entry with required URL field
parent
e11cadbfe1
commit
9d1b74a455
|
@ -40,6 +40,25 @@ export class AddonModDataFieldUrlHandler extends AddonModDataFieldTextHandler {
|
|||
return AddonModDataFieldUrlComponent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get field edit data in the input data.
|
||||
*
|
||||
* @param {any} field Defines the field to be rendered.
|
||||
* @param {any} inputData Data entered in the edit form.
|
||||
* @return {any} With name and value of the data to be sent.
|
||||
*/
|
||||
getFieldEditData(field: any, inputData: any, originalFieldData: any): any {
|
||||
const fieldName = 'f_' + field.id;
|
||||
|
||||
return [
|
||||
{
|
||||
fieldid: field.id,
|
||||
subfield: '0',
|
||||
value: inputData[fieldName] || ''
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check and get field requeriments.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue