[nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget)
-
@baris said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
So the blog comment with the error has the id 6219049e2afd527be4dcf698 and it isn't in the blog-comments mapping. Which means the link between the blog post and topic id is broken. If you get the topic id for that blog post and add it manually to blog-comments it should be fixed.
Actually, let's step back a bit here. It's "broken" because I was unable to establish the link in the first place. I created a new blog post just now, and that behaves the same way. So it's not "missing" - it was never there in the first place!
-
When you publish a blog post there should be a button to publish it to the forum AFAIK. This code should execute https://github.com/psychobunny/nodebb-plugin-blog-comments/blob/master/library.js#L159-L171 and create a topic in nodebb and link the blog post to the nodebb topic. You can put some console.logs in that function to see if it gets executed. If the new blog post is missing from
blog-comments
object it is likely the blog post wasn't published to nodebb or there was an error when publishing it. -
@baris said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
When you publish a blog post there should be a button to publish it to the forum AFAIK.
The issue here is that there is absolutely nothing. It's blank. If you inspect the HTML, you can clearly see the DIV, but it's contents are empty despite the JS being also included. So, the upshot here is that it's not possible to even post ! Below is an example
You'll see the DIV is there, but there, but you can't do anything
Now compare this to one that does work without issue...
-
Ok, so after reading up a bit, I took the plunge and created the key association using the below steps
- Created a new post in NodeBB, and then recorded the ID (in this case, 244)
- Logged into MongoDB and ran the below update statement
db.objects.update({"_id" :ObjectId("619b94d1bd1e82aef790fb9e") },{$set : {"6219049e2afd527be4dcf698":244}});
- This created the association between the blog post, and the NodeBB post, and now it seems to work as intended, although creating the post manually seems to add a phantom comment which doesn't actually exist
There is clearly an issue with this plugin. It works, but only if you actually create the association manually in the database, which of course isn't optimum. In my testing, this plugin seems to think the association already exists so doesn't ask you to create the link, which leads to having to complete the steps above.
In this case, I'm using
Nodebb 1.19.3
andGhost version: 4.34.3
-
@phenomlab does the ghost script get loaded from your NodeBB site?
-
@baris Still the same I'm afraid. Installed, rebuilt and restarted. Also seeing this in the logs
2022-03-10T19:13:05.237Z [4567/195325] - error: GET /comments/get/622a4540dbb475d0e913fa95/0 TypeError: Cannot read property 'postcount' of null at Comments.getCommentData (/home/sudonix/nodebb/node_modules/nodebb-plugin-blog-comments/library.js:95:24) at async /home/sudonix/nodebb/src/routes/helpers.js:60:5 2022-03-10T19:13:31.810Z [4567/195325] - error: GET /comments/get/622a4540dbb475d0e913fa95/0 TypeError: Cannot read property 'postcount' of null at Comments.getCommentData (/home/sudonix/nodebb/node_modules/nodebb-plugin-blog-comments/library.js:95:24) at async /home/sudonix/nodebb/src/routes/helpers.js:60:5
-
@baris said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
Did you make a new blog post after upgrading plugin to 0.8.5? Can you send a link to it?
Yes, here you go
https://content.sudonix.com/testing-2/ -
It was due to an bug I introduced when I rewrote the plugin a while back, when there was no topic found on the nodebb side it was sending back 404, instead it needs to return 200 but an undefined topic id so it can display the publish article button.
fix: do not 404 if mapping isnt established yet · psychobunny/nodebb-plugin-blog-comments@72df076
Lets NodeBB act as a comments engine/widget for your blog - fix: do not 404 if mapping isnt established yet · psychobunny/nodebb-plugin-blog-comments@72df076
GitHub (github.com)