mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-04 07:08:34 +02: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) {
|
formData: function(form) {
|
||||||
var idVal = $(form).find(':input[name=ID]').val();
|
var idVal = $(form).find(':input[name=ID]').val();
|
||||||
if(!idVal) {
|
var data = [{name: 'SecurityID', value: $(form).find(':input[name=SecurityID]').val()}];
|
||||||
idVal = 0;
|
if(idVal) data.push({name: 'ID', value: idVal});
|
||||||
}
|
|
||||||
return [
|
return data;
|
||||||
{name: 'SecurityID', value: $(form).find(':input[name=SecurityID]').val()},
|
|
||||||
{name: 'ID', value: idVal}
|
|
||||||
];
|
|
||||||
},
|
},
|
||||||
errorMessages: {
|
errorMessages: {
|
||||||
// errorMessages for all error codes suggested from the plugin author, some will be overwritten by the config coming from php
|
// errorMessages for all error codes suggested from the plugin author, some will be overwritten by the config coming from php
|
||||||
|
Loading…
Reference in New Issue
Block a user