File upload breaks when there are unsaved changes in parent model.



Note that all the images shows are my baby (Violet is due in July), so I'm not violating any HIPAA laws. :)

Like   (I like that this is a picture of your daughter, not that the file upload is breaking).

I’ve also had trouble with the file upload when creating/cloning a record (when the parent hasn’t been saved yet) but am not sure whether this is a bug thing or “there’s a reason this happens but it’s frustrating” thing.

Thanks, Anna.

If it’s the latter, I can work-around with a model action that saves on changes, but I’d rather avoid that if it’s not necessary.

Matt,  this is quasi-intentional behavior.  What is failing is the attachment model refresh needed to show your recently uploaded picture.  In most cases when there are unsaved changes on a model you are not able to perform actions that force a requery.  For example,  filters and search boxes are disabled when unsaved changes are detected. We don’t want to assume that you want to save the made changes to the database,  yet need to perform a requery in order to complete the action.

What I would reccomend is adding some conditional rendering to your file attachment component so the component is not shown when unsaved changes are detected.

Also.  (Safe Harbor here)  in our next release we will be allowing conditional disabiling,  which would allow you to keep the component visible, but not let users interact with it when changes were detected.   I think that will be the best solution here.  

Thanks, Rob! That makes sense.

Really looking forward to that release…