WalkingPizza / strapi-plugin-placeholder

Serve placeholders with your Strapi images
MIT License
29 stars 20 forks source link

Fix plugin not updating placeholder or throwing 500 on file update. Mark Node 18 as supported. #13

Closed danm36 closed 1 year ago

danm36 commented 1 year ago

When Strapi does a file update, it doesn't provide the URL or MIME props needed to [re]-generate a placeholder. I've added a bit of extra code to generatePlaceholder to fetch the original file's info and to populate these fields if they are missing before being fed to canGeneratePlaceholder, allowing placeholders to be updated when a file is updated, not just created.

I've also fixed a type error in canGeneratePlaceholder should mimeTypes.lookup fail - something that was causing 500 errors when updating a file - and I've updated package.json to also support Node 18.x, as the plugin seems to work without issue.

Fixes #2, #6 and #11

yasssuz commented 1 year ago

@WalkingPizza why hasn't this been merged?

yasssuz commented 1 year ago

@danm36 This may interest you: https://github.com/WalkingPizza/strapi-plugin-placeholder/issues/14