HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Disscussions dissapears after user loged in. only admin can see the articles

if the user moderator logged in, discussions dissapear.


Database Structure Upgrades

The following structure changes are required for your database.

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';

update `GDN_User` `User`
set `Permissions` = '{\"0\":\"Garden.Email.View\",\"1\":\"Garden.Settings.Manage\",\"2\":\"Garden.Settings.View\",\"3\":\"Garden.SignIn.Allow\",\"4\":\"Garden.Users.Add\",\"5\":\"Garden.Users.Edit\",\"6\":\"Garden.Users.Delete\",\"7\":\"Garden.Users.Approve\",\"8\":\"Garden.Activity.Delete\",\"9\":\"Garden.Activity.View\",\"10\":\"Garden.Profiles.View\",\"11\":\"Garden.Profiles.Edit\",\"12\":\"Garden.Curation.Manage\",\"13\":\"Garden.Moderation.Manage\",\"14\":\"Garden.PersonalInfo.View\",\"15\":\"Garden.AdvancedNotifications.Allow\",\"16\":\"Garden.Community.Manage\",\"17\":\"Garden.Uploads.Add\",\"18\":\"Conversations.Conversations.Add\",\"19\":\"Vanilla.Discussions.View\",\"20\":\"Vanilla.Discussions.Add\",\"21\":\"Vanilla.Discussions.Edit\",\"22\":\"Vanilla.Discussions.Announce\",\"23\":\"Vanilla.Discussions.Sink\",\"24\":\"Vanilla.Discussions.Close\",\"25\":\"Vanilla.Discussions.Delete\",\"26\":\"Vanilla.Comments.Add\",\"27\":\"Vanilla.Comments.Edit\",\"28\":\"Vanilla.Comments.Delete\",\"29\":\"Plugins.Pockets.Manage\",\"30\":\"Plugins.Attachments.Upload.Allow\",\"31\":\"Yaga.Reactions.View\",\"32\":\"Yaga.Badges.View\",\"33\":\"Yaga.Ranks.View\",\"34\":\"Plugins.Signatures.Edit\",\"35\":\"Reactions.Positive.Add\",\"36\":\"Reactions.Negative.Add\",\"37\":\"Reactions.Flag.Add\",\"Vanilla.Discussions.View\":[\"-1\"],\"Vanilla.Discussions.Add\":[\"-1\"],\"Vanilla.Discussions.Edit\":[\"-1\"],\"Vanilla.Discussions.Announce\":[\"-1\"],\"Vanilla.Discussions.Sink\":[\"-1\"],\"Vanilla.Discussions.Close\":[\"-1\"],\"Vanilla.Discussions.Delete\":[\"-1\"],\"Vanilla.Comments.Add\":[\"-1\"],\"Vanilla.Comments.Edit\":[\"-1\"],\"Vanilla.Comments.Delete\":[\"-1\"]}'
where `UserID` = '1';

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';

update `GDN_User` `User`
set `Permissions` = ''
where `Permissions` <> '';


When runs the /dba/counts

"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select count(uc.ConversationID) from GDN_UserConversation uc where uc.Convers...' at line 2"



Version 2021.011

«1

Answers

  • after doing this forum working fine.

    but if I change the user roles from the dashboard, again discussions not showing. please help me @R_J

  • Are your Categories set up correctly?

  • Can you mention the exact solution. There is too many solutions

  • can you help me @MrCaspan

  • Okay so the issue we found is that an older version of MySQL has INT values stored in the database but when they are returned they are string values which Vanilla has issues with when doing an absolute comparison.

    So first thing to do is this to see if this is the same issue you are having

    Changing line 888 in the file /applications/dashboard/models/class.permissionmodel.php and add var_dump($permissions);exit; to it

    Original

    887        $permissions = $sql->get()->resultArray();
    888        return $permissions;
    

    To This

    887        $permissions = $sql->get()->resultArray();
    888        var_dump($permissions);exit;
    889        return $permissions;
    

    This will then dump the array $permissions to your screen. Copy the text that gets dumped and paste it here in a code block.


    It will either contain INT values or STRING values

  • edited September 2021

    @MrCaspan Thank you for your reply.

    now I added it.

  • MrCaspanMrCaspan
    edited September 2021

    okay once you add that code hit your site and post back here the text that dumps to your screen. Once you have posted that text to here you can remove that code and its just used to dump that permissions array to the screen

  • array(2) { [0]=> array(59) { ["PermissionID"]=> string(2) "13" ["Garden.Email.View"]=> string(1) "1" ["Garden.Settings.Manage"]=> string(1) "1" ["Garden.Settings.View"]=> string(1) "1" ["Garden.SignIn.Allow"]=> string(1) "1" ["Garden.Users.Add"]=> string(1) "1" ["Garden.Users.Edit"]=> string(1) "1" ["Garden.Users.Delete"]=> string(1) "1" ["Garden.Users.Approve"]=> string(1) "1" ["Garden.Activity.Delete"]=> string(1) "1" ["Garden.Activity.View"]=> string(1) "1" ["Garden.Profiles.View"]=> string(1) "1" ["Garden.Profiles.Edit"]=> string(1) "1" ["Garden.Curation.Manage"]=> string(1) "1" ["Garden.Moderation.Manage"]=> string(1) "1" ["Garden.PersonalInfo.View"]=> string(1) "1" ["Garden.AdvancedNotifications.Allow"]=> string(1) "1" ["Garden.Community.Manage"]=> string(1) "1" ["Garden.Tokens.Add"]=> string(1) "0" ["Garden.Uploads.Add"]=> string(1) "1" ["Vanilla.Tagging.Add"]=> string(1) "0" ["Conversations.Moderation.Manage"]=> string(1) "0" ["Conversations.Conversations.Add"]=> string(1) "1" ["Vanilla.Approval.Require"]=> string(1) "0" ["Vanilla.Comments.Me"]=> string(1) "0" ["Vanilla.Discussions.CloseOwn"]=> string(1) "0" ["Vanilla.Discussions.View"]=> string(1) "1" ["Vanilla.Discussions.Add"]=> string(1) "1" ["Vanilla.Discussions.Edit"]=> string(1) "1" ["Vanilla.Discussions.Announce"]=> string(1) "1" ["Vanilla.Discussions.Sink"]=> string(1) "1" ["Vanilla.Discussions.Close"]=> string(1) "1" ["Vanilla.Discussions.Delete"]=> string(1) "1" ["Vanilla.Comments.Add"]=> string(1) "1" ["Vanilla.Comments.Edit"]=> string(1) "1" ["Vanilla.Comments.Delete"]=> string(1) "1" ["Garden.NoAds.Allow"]=> string(1) "0" ["Plugins.Pockets.Manage"]=> string(1) "1" ["Plugins.Attachments.Upload.Allow"]=> string(1) "1" ["Yaga.Reactions.Add"]=> string(1) "0" ["Yaga.Reactions.Manage"]=> string(1) "0" ["Yaga.Reactions.View"]=> string(1) "1" ["Yaga.Reactions.Edit"]=> string(1) "0" ["Yaga.Badges.Add"]=> string(1) "0" ["Yaga.Badges.Manage"]=> string(1) "0" ["Yaga.Badges.View"]=> string(1) "1" ["Yaga.Ranks.Add"]=> string(1) "0" ["Yaga.Ranks.Manage"]=> string(1) "0" ["Yaga.Ranks.View"]=> string(1) "1" ["Plugins.WhosOnline.ViewHidden"]=> string(1) "0" ["Plugins.Flagging.Notify"]=> string(1) "0" ["Plugins.ExtraPage.View"]=> string(1) "0" ["Plugins.Signatures.Edit"]=> string(1) "1" ["Reactions.Positive.Add"]=> string(1) "1" ["Reactions.Negative.Add"]=> string(1) "1" ["Reactions.Flag.Add"]=> string(1) "1" ["JunctionTable"]=> NULL ["JunctionColumn"]=> NULL ["JunctionID"]=> NULL } [1]=> array(59) { ["PermissionID"]=> string(2) "14" ["Garden.Email.View"]=> string(1) "0" ["Garden.Settings.Manage"]=> string(1) "0" ["Garden.Settings.View"]=> string(1) "0" ["Garden.SignIn.Allow"]=> string(1) "0" ["Garden.Users.Add"]=> string(1) "0" ["Garden.Users.Edit"]=> string(1) "0" ["Garden.Users.Delete"]=> string(1) "0" ["Garden.Users.Approve"]=> string(1) "0" ["Garden.Activity.Delete"]=> string(1) "0" ["Garden.Activity.View"]=> string(1) "0" ["Garden.Profiles.View"]=> string(1) "0" ["Garden.Profiles.Edit"]=> string(1) "0" ["Garden.Curation.Manage"]=> string(1) "0" ["Garden.Moderation.Manage"]=> string(1) "0" ["Garden.PersonalInfo.View"]=> string(1) "0" ["Garden.AdvancedNotifications.Allow"]=> string(1) "0" ["Garden.Community.Manage"]=> string(1) "0" ["Garden.Tokens.Add"]=> string(1) "0" ["Garden.Uploads.Add"]=> string(1) "0" ["Vanilla.Tagging.Add"]=> string(1) "0" ["Conversations.Moderation.Manage"]=> string(1) "0" ["Conversations.Conversations.Add"]=> string(1) "0" ["Vanilla.Approval.Require"]=> string(1) "0" ["Vanilla.Comments.Me"]=> string(1) "0" ["Vanilla.Discussions.CloseOwn"]=> string(1) "0" ["Vanilla.Discussions.View"]=> string(1) "1" ["Vanilla.Discussions.Add"]=> string(1) "1" ["Vanilla.Discussions.Edit"]=> string(1) "1" ["Vanilla.Discussions.Announce"]=> string(1) "1" ["Vanilla.Discussions.Sink"]=> string(1) "1" ["Vanilla.Discussions.Close"]=> string(1) "1" ["Vanilla.Discussions.Delete"]=> string(1) "1" ["Vanilla.Comments.Add"]=> string(1) "1" ["Vanilla.Comments.Edit"]=> string(1) "1" ["Vanilla.Comments.Delete"]=> string(1) "1" ["Garden.NoAds.Allow"]=> string(1) "0" ["Plugins.Pockets.Manage"]=> string(1) "0" ["Plugins.Attachments.Upload.Allow"]=> string(1) "0" ["Yaga.Reactions.Add"]=> string(1) "0" ["Yaga.Reactions.Manage"]=> string(1) "0" ["Yaga.Reactions.View"]=> string(1) "0" ["Yaga.Reactions.Edit"]=> string(1) "0" ["Yaga.Badges.Add"]=> string(1) "0" ["Yaga.Badges.Manage"]=> string(1) "0" ["Yaga.Badges.View"]=> string(1) "0" ["Yaga.Ranks.Add"]=> string(1) "0" ["Yaga.Ranks.Manage"]=> string(1) "0" ["Yaga.Ranks.View"]=> string(1) "0" ["Plugins.WhosOnline.ViewHidden"]=> string(1) "0" ["Plugins.Flagging.Notify"]=> string(1) "0" ["Plugins.ExtraPage.View"]=> string(1) "0" ["Plugins.Signatures.Edit"]=> string(1) "0" ["Reactions.Positive.Add"]=> string(1) "0" ["Reactions.Negative.Add"]=> string(1) "0" ["Reactions.Flag.Add"]=> string(1) "0" ["JunctionTable"]=> string(8) "Category" ["JunctionColumn"]=> string(20) "PermissionCategoryID" ["JunctionID"]=> string(2) "-1" } }
    
  • Yeah so it looks like you are having the same issue as others were having. So your hosting do you have access to cPanel or how does your hosting work?

  • @MrCaspan yes it's cpanel hosting. I have access to the cpanel.

  • Okay so you will need to do the following. Go into cPanel and go to "Select PHP Version"

    After you are done that refresh your site and see if it works now

  • It looks like you have the right ones enabled. Were these already enabled?



  • I did it yesterday after reading other discussion.

  • okay so the right ones are enabled that's great. We are going to do a phpinfo(); to see what PHP is actually running. Can you go back to that line 888 and put phpinfo();exit; instead of that other line that you added before. then search for mySQL and take a screen show of the MySQL

Sign In or Register to comment.