Merge pull request #1708 from albertgasset/MOBILE-2795

Mobile 2795
main
Juan Leyva 2019-01-07 13:38:39 +01:00 committed by GitHub
commit 8ae36fc8f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -40,6 +40,25 @@ export class AddonModDataFieldUrlHandler extends AddonModDataFieldTextHandler {
return AddonModDataFieldUrlComponent; 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. * Check and get field requeriments.
* *

View File

@ -276,10 +276,7 @@ export class AddonModDataEditPage {
}); });
}).catch((error) => { }).catch((error) => {
this.domUtils.showErrorModalDefault(error, 'Cannot edit entry', true); this.domUtils.showErrorModalDefault(error, 'Cannot edit entry', true);
return Promise.reject(null);
}); });
} }
/** /**