Open Wieter opened 3 years ago
Some findings:
https://github.com/bolt/core/blob/6bf1db6f7994193b6c90622fe5d127388582969a/assets/js/app/editor/Components/Image.vue#L126 previewImage is checked for empty string, but further down thumbnailImage
is used.
https://github.com/bolt/core/blob/6bf1db6f7994193b6c90622fe5d127388582969a/assets/js/app/editor/Components/Embed.vue#L87 no check is embedded to test if this field might be empty, then if empty :style="
background-image: url('${previewImage}')"
could cause this 404 while trying to retrieve null.
hi @Wieter , nice little catch! Would you like to create a small PR to fix this, so that you also show up as a bolt/core contributor? :-)
Sure, I have to work on some other fixes as well (postgres related).
Not breaking, but some room for a small improvement.
While setting up a new website, and editing pages/entries/(doesn't really matter what), I noticed a 404 response in the console:
GET https://.../bolt/edit/null 404 (Not Found)
This I traced back to an empty image field (there was no 'Highlighted image' for the ContentType which is being edited, which is correct) The preview image field is templated to become the following:<a class="editor__image--preview-image" style="background-image: url('null');"></a>
Probably a check need to be made if 'null' is returned, and then just omit setting the background-image.I haven't dissected yet where the template is rendered, will do so in due time :)
Details
Reproduction
Bug summary
404 for pages/entries/.. without highlighted image in editor
Specifics
Steps to reproduce
Expected result
No unnecessary 'chitchat' with the server when no image is present
Actual result
404 in the background, trying to resolve 'null'