mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #2630 from chillu/pulls/uploadfield-id
Conditionally send "ID" val in UploadField
This commit is contained in:
commit
631d313d66
@ -186,13 +186,10 @@
|
||||
{
|
||||
formData: function(form) {
|
||||
var idVal = $(form).find(':input[name=ID]').val();
|
||||
if(!idVal) {
|
||||
idVal = 0;
|
||||
}
|
||||
return [
|
||||
{name: 'SecurityID', value: $(form).find(':input[name=SecurityID]').val()},
|
||||
{name: 'ID', value: idVal}
|
||||
];
|
||||
var data = [{name: 'SecurityID', value: $(form).find(':input[name=SecurityID]').val()}];
|
||||
if(idVal) data.push({name: 'ID', value: idVal});
|
||||
|
||||
return data;
|
||||
},
|
||||
errorMessages: {
|
||||
// errorMessages for all error codes suggested from the plugin author, some will be overwritten by the config coming from php
|
||||
|
Loading…
x
Reference in New Issue
Block a user