Guest pics broken on home page



  • Hi all, my scenario is that I am using nodeBB for a tech conference and I basically want to allow guests to post questions to various categories without having to register. I have nodeBB v0.5.0-4 running on an Ubuntu 14.04 server.

    I set the permissions on a "test" category to allow guests to have all permissions, find topic, access & read, add new topics and post replies. I noticed that the access seems correct, a guest can click a category from the home page, add new topic, with reply - but once you look at the post on the "home" page, instead of the guest picture, there's some code saying "...posts.user.username}" showing in place of the image. See screenshot.

    Is this a known bug?

    Any tips or solution would be appreciated!

    Cheers,
    Chris

    image.jpg



  • Can you go to yourURL/api/ (adjust your URL as necessary) and look inside the categories, then posts, then user then username.

    It will likely be minified, so copy it all and put it into jsonlint.org to unminify it. It seems that the guest posting is coming back as blank, and not guest (like it should) could be theme related, or a regression.

    Can you make sure everything is up to date by running npm up In your nodebb folder.



  • Hi @a_5mith , thanks for your help. I went to mynodebb/api as you suggested. Below is what I see after running it though jsonlint.org...

    {
    "categories": [
    {
    "cid": "1",
    "name": "Announcements",
    "description": "Announcements regarding our community",
    "icon": "fa-bullhorn",
    "bgColor": "#0059B2",
    "color": "#fff",
    "slug": "1/announcements",
    "topic_count": "0",
    "post_count": "0",
    "disabled": false,
    "order": "1",
    "link": "",
    "numRecentReplies": "4",
    "class": "col-md-3 col-xs-6",
    "imageClass": "auto",
    "backgroundImage": "",
    "unread-class": "",
    "posts": []
    },
    {
    "cid": "3",
    "name": "Desktop Support Questions",
    "description": "Ask your Desktop Support questions here!",
    "icon": "fa-github",
    "bgColor": "#0059B2",
    "color": "#fff",
    "slug": "3/desktop-support-questions",
    "topic_count": "1",
    "post_count": "1",
    "disabled": false,
    "order": "3",
    "link": "",
    "numRecentReplies": "4",
    "class": "col-md-3 col-xs-6",
    "imageClass": "auto",
    "backgroundImage": "",
    "unread-class": "unread",
    "posts": [
    {
    "pid": "1",
    "tid": "1",
    "content": "<p>this is a test</p>\n",
    "uid": "0",
    "timestamp": "1410446411413",
    "deleted": "0",
    "index": 1,
    "topic": {
    "tid": "1",
    "title": "test",
    "cid": "3",
    "slug": "1/test",
    "deleted": "0"
    },
    "category": {
    "cid": "3",
    "name": "Desktop Support Questions",
    "icon": "fa-github",
    "slug": "3/desktop-support-questions"
    },
    "relativeTime": "2014-09-11T14:40:11.413Z"
    }
    ]
    },

    "loggedIn": false
    

    }

    Also, I did an inspect on the broken "guest" image on the logged out site, and compared to the logged in. There was a difference. The logged out code says
    <img src="{categories.posts.user.picture}" title..." whereas the logged in code related to the guest pic says...
    <img src="https://secure.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e? size =128&default=identicon&rating=pg" alt="Guest" class="profile-image user-img" title data-original title="Guest">

    See screeenshots. Does this give any clue to what's going on with the broken "Guest" pics? Thanks again!

    nodebb_guestpic1.jpg
    nodebb_guestpic2.jpg



  • Ok, so it works when you're logged in, but when you're a guest, you see {categories.posts.user.picture} rather than the gravatar. It seems to only be happening on the Announcements Category. As the post data for Desktop Support seems unaffected. Can you see the post/avatar you created in "Desktop Support Questions" as a guest? Does this happen in all browsers?

    Does the post open when you click the topic? If so, what is the number in your URL after /topic/ Or does it 404? Can you try refreshing your Cache with Ctrl Shift Delete in your browser, selecting cache, then changing the time parameter to All Time.



  • Thanks @a_5mith . Sorry for any confusion . Well, when you're looking at the home page whether logged in or logged out the "guest" pic is broken. Where it appears is if you click into the Category. For example, if I go to http://mynodebb and do not login the post shows a broken image, then if I login, and view the home page, the image for guest is still broken. However, if I click into the Desktop Support category, the image shows there (from within the category). The image with the gravatar address is coming in when viewing in the category.


Log in to reply
 

Suggested Topics

| |