fix: CSV upload failure
This commit is contained in:
parent
39fa75cfca
commit
9a66f185e7
2 changed files with 15 additions and 5 deletions
|
|
@ -835,10 +835,11 @@ export default class Grid {
|
|||
$.each(row, (ci, value) => {
|
||||
var fieldname = fieldnames[ci];
|
||||
var df = frappe.meta.get_docfield(me.df.options, fieldname);
|
||||
|
||||
d[fieldnames[ci]] = value_formatter_map[df.fieldtype]
|
||||
? value_formatter_map[df.fieldtype](value)
|
||||
: value;
|
||||
if (df) {
|
||||
d[fieldnames[ci]] = value_formatter_map[df.fieldtype]
|
||||
? value_formatter_map[df.fieldtype](value)
|
||||
: value;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -927,7 +927,16 @@ Object.assign(frappe.utils, {
|
|||
// decodes base64 to string
|
||||
let parts = dataURI.split(',');
|
||||
const encoded_data = parts[1];
|
||||
return decodeURIComponent(escape(atob(encoded_data)));
|
||||
let decoded = atob(encoded_data);
|
||||
try {
|
||||
const escaped = escape(decoded);
|
||||
decoded = decodeURIComponent(escaped);
|
||||
|
||||
} catch (e) {
|
||||
// pass decodeURIComponent failure
|
||||
// just return atob response
|
||||
}
|
||||
return decoded;
|
||||
},
|
||||
copy_to_clipboard(string) {
|
||||
let input = $("<input>");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue