Data disappears from form upon loading on edit

When I try to edit a document using quickforms, the data shows in the form on load and then quickly disappears. I’m assuming it has something to do with an update to the aldeed:autoform package because it used to populate the form where I could see what I was editing. I’m just wondering if anyone else had this issue or knows why.

Not aware of the issue, but because you didn’t send any examples I can’t help you either. Would you mind to share some?

Here’s a screenshot of what’s happening.com-video-to-gif

Source code or it didn’t happen

1 Like

I’m on the same page as @sbr464. However, I can take a wild guess. Do you happen to have a ‘scoped’ publication to the data on the list page? If that’s the case, the app will automatically ‘unsubscribe’ when you switch the page. This means that the article will also be automatically removed from the client side. Meaning the form will be empty. Its a common mistake.

To solve it you can add a subscription that subscribes to just the ID of that document.

This means:

Template.docDetails.onCreated(function() {
  const docId = FlowRouter.getParam('id');
  this.subscribe('documents', docId);
});
3 Likes

I figured it was unsubscribing. I just wondered why since it had been working for the last 2 years. Your wild guess was correct, and I was able to fix it. Thank you!