Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ $xwiki.jsx.use($attachmentPickerDocName)
function uploadTemporaryAttachment() {
// Require jquery locally until we are able to fully migrate this code away from prototype.
const form = this.property.up('form');
var propertyName = this.property.down('.property-reference').name;
require(['jquery'], function ($) {
const data = new FormData();
const uploadedFile = $('#attachfile')[0].files[0];
Expand Down Expand Up @@ -510,7 +511,7 @@ $xwiki.jsx.use($attachmentPickerDocName)
.prop('type', 'hidden')
.prop('name', 'uploadedFiles')
.prop('value', response.fileName))
$(form).find('input[type="hidden"].property-reference').prop('value', response.fileName);
$(form).find(`input[type="hidden"].property-reference[name="${propertyName}"]`).prop('value', response.fileName);
Comment thread
mathpce marked this conversation as resolved.
Outdated
this.updateAttachment(response.fileName, response.url);
this.dialog.closeDialog();
}.bind(this)).fail(function () {
Expand Down