Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only Administrators or members of the publishers group can publish articles #22

Closed
adenau opened this issue Nov 30, 2014 · 4 comments
Closed

Comments

@adenau
Copy link

adenau commented Nov 30, 2014

Hi,

I'm having a few problems getting Ghost/Nodebb integration to work. To make things more complicated, I'm running both software on two different hosts.

I've installed the latest version of Ghost (0.5.3), NodeBB (0.6.0) and the integration plugin from npm. Both sites are proxies through NGINX. I login using my administrator account in both ghost in nodebb. When I look at an article, I can need the Publish this Article to NodeBB button. However, if I press it, I receive the following message :

{"error":"Only Administrators or members of the publishers group can publish articles"

I can confirmed that I am properly logged in, as I can just go back to the root of NodeBB and the administration menu. I've confirmed that I am using the proper categorie in my plugin configuration, and that administrator has the proper rights to post to that category.

I've integrated in Ghost using the following code

<a id="nodebb/comments"></a>
<script type="text/javascript">
var nodeBBURL = 'http://forums.technodabbler.com',
    articleID = '{{post.id}}';

(function() {
var nbb = document.createElement('script'); nbb.type = 'text/javascript'; nbb.as
ync = true;
nbb.src = nodeBBURL + '/plugins/nodebb-plugin-blog-comments/lib/embed.min.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body
')[0]).appendChild(nbb);
})();
</script>
<noscript>Please enable JavaScript to view comments</noscript>

Any ideas?

@adenau
Copy link
Author

adenau commented Nov 30, 2014

I did some more investigating. In library.js, I found the piece of code doing the security check and decided to disable it, just to check out what happens. When publishing the post, I got the following error message instead.

{"error":"[[error:title-too-short, 3]]"

At this point, I got very suspicious of the integration code. So I decided to inspect the integration code before it finished running

     var nodeBBURL = 'http://forums.technodabbler.com',
         articleID = '';

     (function() {
     var nbb = document.createElement('script'); nbb.type = 'text/javascript'; nbb.async = true;
     nbb.src = nodeBBURL + '/plugins/nodebb-plugin-blog-comments/lib/embed.min.js';
     (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(nbb);
     })();

Interesting. Post ID was not set. First solution was to change

articleID = '{{id}}';

That helped, but the button is still not getting its tags set properly.

<form action="http://forums.technodabbler.com/comments/publish" method="post">
        <button class="btn btn-primary">Publish this article to NodeBB</button>
        <input type="hidden" name="markdown" id="nodebb-content-markdown">
        <input type="hidden" name="title" id="nodebb-content-title">
        <input type="hidden" name="tags" id="nodebb-content-tags">
        <input type="hidden" name="id" value="80">
        <input type="hidden" name="url" value="http://www.technodabbler.com/brick-pi-raspberry-lego/">
        <input type="hidden" name="_csrf" value="{token}">
    </form>

I'll continue investigating, but this is getting very complicated.

Cheers,

@adenau
Copy link
Author

adenau commented Nov 30, 2014

Figured out the the plugin doesn't work because of the Ghost API change. Even worse, the problem was reported one month ago and nothing has been done. That's close to 8 hours of work lost on this.

#17

I was very impressed with NodeBB as a product, but the integration with Ghost doesn't seem ideal. I'll look for something else instead.

@adenau adenau closed this as completed Nov 30, 2014
@fczuardi
Copy link

This bug should be reopened since it is not fixed yet. Are discussions going on #17?

@psychobunny
Copy link
Owner

Sorry about causing you grief, but yeah, I am waiting on one of Ghost's issues to be closed before I put time into this. In #17 there is a mention of a hotfix, which isn't ideal but works. Our blog is still using an older version of Ghost as well: https://blog.nodebb.org/nodebb-v0-5-0-released/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants