Insert Model 3D

Hi there,

Sorry for the delay in replying to this. I was tied up with contract work last week.

Anyway, I’ve had another look just now, and I think that I’ve identified the code that decides if an upload lives or dies. In the server side code for processing a post there is a routine called ‘each_upload_url’ that will generate a list of uploaded files that are referenced in a post.

Now I’m not a Ruby dev, but from what I can make out it’s looking for URLs referenced by a predefined list of HTML tags. So for the insert video theme component that I copied, the src attribute of any <source> HTML element is recognised as an upload, and the poster attribute of any <video> HTML element is recognised as an upload. For my insert model 3d component though,the <model-viewer> HTML element is not in the list and so the assets it references are not recognised as uploads and so after a few days they will be purged.

The long term fix for this might to be to change the server side code so that model-viewer attributes are recognised as a source of uploads, but I think that it should also be possible to work around this for now by adding in explicit HTML <a> tags linking to the uploads.

I’m going to post in the Contribute > Bug category to check that my understanding is correct, but on the off-chance that my understanding is correct I’ve submitted a fix to the Insert Model 3D theme component that inserts some hidden <a> tags into the post that reference the uploaded model and poster. @patrickemin If you have some time, could you please check to see if this resolves the issue for you? You’d need to update the component and then reupload any 3D model assets that have been purged.