Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

What could cause usernames to not display in the activity feed?

Hey folks,

I'm running Vanilla 2.0.18.8 and I've got an pretty weird issue where usernames are not being displayed in the activity text (see the attached screenshot).

I traced it to line 156 of applications/dashboard/views/activity/helper_functions.php where $Sender->ProfileUserID is an empty string.

$Sender seems to be an instance of ActivityController, however, from what I can tell in the code (with the help of grep -nr ProfileUserID .) the ProfileUserID property is set on ProfileController and is otherwise set to an empty string if the sender does not have the property.

Here's a list of third party plugins that I am currently using:

  • FileUpload
  • Last Edited
  • Pockets
  • Post Count
  • Quotes
  • Signatures
  • Sitemaps
  • Vanilla jsConnect
  • Vanilla SEO
  • Voting
  • WhosOnline

Maybe I'm overcomplicating this and digging my own rabbit hole, but I'm unfamiliar with Garden/Vanilla internals and debugging practices to be able to pin down this issue.

Any assistance would be much appreciated!

Thanks.

Best Answer

  • peregrineperegrine MVP
    edited January 2014 Answer ✓

    out of curiousity can you post your activitytype table.

    yours

      <div class="Author Photo">
      <a class="Photo" href="/profile/5/tadtad54" title="tadtad54">
      <img class="ProfilePhotoMedium" alt="tadtad54" src="http://gravatar.com/avatar/91cfceee99266cb07950dc4200629218">
       </a>
       </div>
       <div class="ItemContent Activity">
       <div class="Title">joined.</div>
       <div class="Excerpt">Welcome Aboard!</div>
    

    vs. a good one

    <div class="Author Photo">
    <a class="Photo" href="/profile/3/me" title="me">
    <img class="ProfilePhotoMedium" alt="tadtad54" src="http://gravatar.com/avatar/91cfceee9926666666666660629218">
    </a>
    </div>
    <div class="ItemContent Activity">
    <div class="Title">
    <a href="/vanilla/profile/3/Me">were</a>
    joined.
    </div>
    <div class="Excerpt">Welcome Aboard!</div>
    

    you are obviously picking up profile for the photo.

    what is the value for full headline in your activity type table . can you post it.

    especially type 2 3 4 and 5

    try changing activity type 2 full headline to %1$s joined my test again.

    and see what if it produces. "username" joined my test again.

    if it doesn't give you any changes.

    but since you have nothing in your installation - it might be worth re-installing over testing a few registrations, looking at activity and then if it works add in your theme

    • and plugins.

    if your forum is called vanilla I would just rename it to oldvanilla. And start with a fresh new folder.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Answers

  • hgtonighthgtonight MVP
    edited January 2014

    Welcome to the community!

    First thing we need to do is determine if the problem is caused by your theme, your plugins, or vanilla core. Please follow the steps below.

    • Revert to the default theme.
      • Your theme is the issue, please post a copy of your theme we can inspect
    • Disable all your plugins
      • One of the plugins is the issue
      • Enable each plugin one by one until the issue reappears
        • This is the suspect plugin, post the version number
    • The core seems to be at fault
      • Post any and all modifications you made to the core (hopefully this is none)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • peregrineperegrine MVP
    edited January 2014

    the "join message" can also be a result of changing definitions incorrectly. perhaps not in your case.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Apologies for the late response on this (been swamped with work).

    I have tried reverting to the default theme and disabling all plugins with no luck. I have not made any modifications to the core and have kept my changes localized to my theme.

    Is there possibly an issue with my database? Being a noob, is it possible to have inadvertently deleted a value in the database (issuing SQL queries to update stuff here and there is not uncommon for me) and if so is there a place I could start looking? The GDN_ActivityType table seems fine is there anywhere else I could look?

    Thanks

  • peregrineperegrine MVP
    edited January 2014

    I have tried reverting to the default theme and disabling all plugins with no luck. I have not made any modifications to the core and have kept my changes localized to my theme.

    when you did this test - did you delete the ini files in your /cache folder.

    also follow these steps again

    http://vanillaforums.org/discussion/comment/199091/#Comment_199091

    you also will not be able to fix old entries in your activity table if the table data is wrong - but you should be able to test with new user.. but you should test a new user that joins after you reduce the situation to no plugins (except htmlawed - don't disable) and default theme and downloaded core.

    while you are at upgrade to 2.0.18,.10 - otherwise you may have worse problems than you are currently experiencing. (i.e. Security fixes).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Hey, thanks or the reply!

    I actually upgraded to 2.0.18.10 when I saw the security headline on theses forums as I was posting my initial question.

    I followed the steps you linked, including the /utility/structure which seemed promising since it did actually update a bunch of stuff in the database but unfortunately still no go.

    I've disabled the theme and plugins, cleared the cache and set my registration method to Basic to register a new user and when I did I still got the empty "joined" line in the activity feed for the new user.

    At this point am I better off reinstalling? Any continued advice is much appreciated!.

  • Do user names show up if someone posts to the activity feed?

    Go to the activity page and try commenting.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Yeah my username seems to show up. It's just the "%s joined." doesn't actually format the username into %s because the value it needs is empty so I end up with "joined."

  • And is the data empty in the activity table for the joined items?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Everything appears to be okay, see attached file for screenshot. The InsertUserID is null, tried changing it just in case but that didn't seem to affect it.

  • look in the activity table and see if there is an activityuserid for all of the Welcome Aboard messages

    SELECT ActivityID, Story FROM GDN_Activity WHERE ActivityTypeID = "4"

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Yep all my activity records have a ActivityUserID value.

  • edited January 2014

    What happens if you change the RegardingUserID property of one of the activities?

    Add Pages to Vanilla with the Basic Pages app

  • I hadn't thought of that, but unfortunately that did not work either. I'm deleting the cache every time I make a change too. :(

  • So are you saying no activity has a name attached when viewing activity or just the welcome user joined.

    I was under the impression it was just welcome messages.

    when you pm a user does that get shown viewing the activity with a name.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • edited January 2014

    The best way to find out why usernames aren't showing up is to continue debugging from where you finished tracing through the files. In addition, would you be able to install a new download of Vanilla 2.0.18.10 within a separate folder and database just as a test to see if the problem shows up in that version? If that doesn't work, would you be able to see if the problem shows up with Vanilla 2.1b2? Also, what version of PHP are you using?

    Add Pages to Vanilla with the Basic Pages app

  • peregrineperegrine MVP
    edited January 2014 Answer ✓

    out of curiousity can you post your activitytype table.

    yours

      <div class="Author Photo">
      <a class="Photo" href="/profile/5/tadtad54" title="tadtad54">
      <img class="ProfilePhotoMedium" alt="tadtad54" src="http://gravatar.com/avatar/91cfceee99266cb07950dc4200629218">
       </a>
       </div>
       <div class="ItemContent Activity">
       <div class="Title">joined.</div>
       <div class="Excerpt">Welcome Aboard!</div>
    

    vs. a good one

    <div class="Author Photo">
    <a class="Photo" href="/profile/3/me" title="me">
    <img class="ProfilePhotoMedium" alt="tadtad54" src="http://gravatar.com/avatar/91cfceee9926666666666660629218">
    </a>
    </div>
    <div class="ItemContent Activity">
    <div class="Title">
    <a href="/vanilla/profile/3/Me">were</a>
    joined.
    </div>
    <div class="Excerpt">Welcome Aboard!</div>
    

    you are obviously picking up profile for the photo.

    what is the value for full headline in your activity type table . can you post it.

    especially type 2 3 4 and 5

    try changing activity type 2 full headline to %1$s joined my test again.

    and see what if it produces. "username" joined my test again.

    if it doesn't give you any changes.

    but since you have nothing in your installation - it might be worth re-installing over testing a few registrations, looking at activity and then if it works add in your theme

    • and plugins.

    if your forum is called vanilla I would just rename it to oldvanilla. And start with a fresh new folder.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Oh wow.

    Changing %1 to %1$s as you said fixed it for me. Why is that so? Should I also be doing this for the other values in that table?

    See the screenshot for my ActivityType table:
    image

    And here's what my activity feed looks like now that it works:
    image

    Thank you so much for helping me resolve this. I am also eager to know why doing what you said fixes it if you don't mind explaining!

  • Is this an install that you have upgraded from an old version? What was the original install version?

    I don't need to know, just trying to figure out how this modification could occur in the wild.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • So this turns out to be completely my fault.

    I actually created scripts that provision a dev instance of the forums for our virtualized environments using Vagrant provisioners, however, some of the scripts are setup to import SQL inline from the script and as such $s was sometimes misinterpreted for a Bash variable and subsequently resulted in an empty string in its place.

    One of the things I could have done is probably placed the SQL into a .sql file instead to avoid this kind of issue. I'm very, very sorry for making you guys troubleshoot what was clearly a really stupid mistake on my part.

    Again, thanks to all for the help.

  • Hey, no major harm done. Glad peregrine could sort it out for you. :D

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.