I haven’t received that email as yet
I am in.
I just created a test review and everything worked as expected. You can see the review here https://introvertedreader.com/index.php/review/test-review/
(The review is set to private, so only logged in admins on your site can see it)
Can you tell what I’m doing wrong from my draft?
The only thing I did was paste in the ISBN and click the “Fetch” button, nothing else.
It’s so weird. Yours is acting perfectly for me. I’ve tried to break it and I can’t. I’ve tried several other reviews myself. They behave as long as I keep the visibility private. As soon as I change it to public, the preview starts showing the default cover again. Yours doesn’t do that at all.
Hello again @captaincurls,
I just looked at a draft you have created and I now notice the issue you have described. So now I am testing to see if I can recreate this issue on my test website.
I am so sorry to bother you with this! I see a lot of value in your plugin and I really want to get it working! Thank you so much for your patience!
No worries, I got you. If I can re-create this is I can fix it.
So… I just re-created this issue on 2 different sites. I know what it is happening but not why it is happening. Plus, it only happens with the Gutenberg editor.
I will need to take tomorrow to resolve this issue as I am not too familiar with Gutenberg’s code.
I can somewhat recreate it in the standard editor after turning off Gutenberg support in the plugin settings. It’s not exactly the same bug, but it’s close. If I preview it in the standard editor while it’s public, I’ll lose the cover, even if I change to private afterward. If I remember to set visibility to private before previewing, I’m golden. The cover doesn’t change even if I change the visibility to public afterward.
Hello @captaincurls
I have spent the last day and a half working on this issue, however I haven’t come up with a viable solution via code.
Due to the way how WordPress works when saving a post/review I have to specifically wait until I am certain a review is being saved to the database before I trigger saving the book cover to the media library. When saving a “draft” WordPress save a “revision” to the database, it also saves a revision every 5 minutes, so I have to skip saving the book cover here else that process of fetching and saving the cover repeatedly.
Then there is the issue of Gutenberg only triggering a process I need only if you’re in the “document” mode instead of the “block” mode…
Basically, my only solution for right now is to fetch the book cover before you publish a review.
I will have to re-think and rewrite the whole process of fetching, saving and attaching a book cover to reviews in a future update.
So I shouldn’t even attempt to fetch the cover until I’m ready to press publish? That’s doable. Thank you for your time and your effort! Good luck getting this re-written for a future update!
Yes, for now.
Also, if you’re using the “Simple” template for reviews, you can add the follow CSS code to the “Custom styles” section under the “Templates” tab of the plugin’s settings page.
.review-content .book-cover-container {
width: 20%;
}