Skip to content

Commit 88bb320

Browse files
committed
Use AutoForm.getFormId() instead of jquery .closest()
1 parent e7b46a2 commit 88bb320

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/client/fileUpload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Template.afFileUpload.onCreated(function () {
7070
this.currentUpload = new ReactiveVar(false);
7171
this.inputName = this.data.name;
7272
this.fileId = new ReactiveVar(this.data.value || false);
73-
this.formId = this.data.atts.id;
73+
this.formId = AutoForm.getFormId();
7474
return;
7575
});
7676

@@ -148,7 +148,7 @@ Template.afFileUpload.events({
148148
const upload = template.collection.insert(opts, false);
149149
let ctx;
150150
try {
151-
ctx = AutoForm.getValidationContext($(e.target).closest("form").attr('id'));
151+
ctx = AutoForm.getValidationContext(template.formId);
152152
} catch (exception) {
153153
// Fix: "TypeError: Cannot read property '_resolvedSchema' of undefined"
154154
ctx = AutoForm.getValidationContext();

0 commit comments

Comments
 (0)