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.

User Permissions

Using Vanilla 2.1

For Guests I am setting the User permissions as only Garden>View>Activity. Essentially, I don't want guests doing / seeing anything until they become a member or login.

Now a Guest if he clicks on Discussion Link gets a Page " Whoops Invalid function Call ".

First Question : How do I change this page text to something more clear- like "You need to register /login to see the Wonderful Stuff here " :-)

Users can login and do things as expected.BUT any user ( even me the admin! ) when he tries to logout he sees :

" Whoops! Invalid function call."

Second Question : How do I put something better - say a "Come Back soon for More " message here ?

Help please !

Comments

  • Just wanted to add in - could this behavior be due the fact I " upgraded " recently from Vanilla 2.0.18 to 2.1 ? Since then I am seeing the login screen " flashes" 2-3 times before settling in .. but then I am able to login and do all other stuff....

  • What plugins do you have enabled?

    Disable them all and see if your issue is resolved. If it is, enable tour plugins one by one until the problem comes back.

    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.

  • I did that .. Problem remains even when all plugins are disabled. Tried changing the theme as well. No go. The login screen flash seems to be due plugin login radius. As of now I have made a guest category to whom guest are allowed to view and to no other category. So the whoops page is not showing up.....

    But this problem seems specific to this vanilla install consequent to upgrading as on another domain where I put vanilla 2.1 only recently from scratch I am not having this issue....

  • But this problem seems specific to this vanilla install consequent to upgrading as on another domain where I put vanilla 2.1 only recently from scratch I am not having this issue....

    which problem? you mentioned a few problems.

    as an aside which may indicate that a plugin or theme or residual code or something in your config.php is causing issue.

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

  • Also, many forum owners make it so activity is NOT viewable for guests, to cut down on spam related activity.

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

  • My problem is as in initial question ... Why am I getting those " whoops pages " ... And only on this install ( say Forum A) which is an upgrade and not on the other install ( say Forum B ) where vanilla 2.1 was set from scratch. And how can I, on this upgraded install, revert to the " normal behavior " whereby the guests do not see anything . Thanks for the tip re Activity... Will remove that permission also for Guests.
    Hope I am clearer ....will copying the config.php file from a vanilla 2.1 downloaded recently over to this forum A help ?
    As background Forum A was initially set about a year ago.... Then i didn't do much, only recently came back....

  • peregrineperegrine MVP
    edited July 2014

    ....will copying the config.php file from a vanilla 2.1 downloaded recently over to this forum A help ?

    Do a comparison of the config statements between the two! and it may provide you some info. You could do a straight copy from one to the other, but don't do it blindly, you will obviously need to change a few of the config statements relating to password, host,etc.

    also compare your .htaccess files.

    keep a copy of the old configs, before you copy, in case you run into more problems.

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

  • revert to the " normal behavior " whereby the guests do not see anything .

    that is not the default behavior. "normal" is a subjective term.

    if you want to only allow guests (non-logged in users) to signin or register, go into dashboard for roles and permissions for guests and uncheck everything.

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

  • Yes, as most things are :-) Yes that is what I have done for the Guests- works, except for that Whoops page problem Will look at config.php and.htaccess files....

  • peregrineperegrine MVP
    edited July 2014

    post your .htaccess file of the forum that give you the whoops.

    and where is the folder location of your forum?

    and post a screenshot of what is being clicked that gives you the whoops page.

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

  • Folder Location -
    /public_html/getjoy/enjoy

    .htacess file -

    Modified

    If you modify this file then change the above line to: # Modified


    RewriteEngine On
    # Certain hosts may require the following line.
    # If vanilla is in a subfolder then you need to specify it after the /.
    # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
    # RewriteBase /enjoy
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]

    ( Note : Even before this modification the behavior was the same... )

    When I go to http://getjoy.in/enjoy/

    I get the Whoops page. Snapshot of the Whoops page enclosed.

    As of now, I have created a "Guests" Category and edited the permission of the Guests Role so that they may view only this Category. one Post " Login Required " is made in this Category. Then, Guests see the page as in "GuestPage.png" attached.


    Pl advise, thanks much...

  • I have also checked the config.php file and made the following changes

    // Conversations
    $Configuration['Conversations']['Version'] = '2.0.18.8';
    Changed to:
    $Configuration['Conversations']['Version'] = '2.1';

    // Vanilla
    $Configuration['Vanilla']['Version'] = '2.0.18.8';
    Changed to :
    $Configuration['Vanilla']['Version'] = '2.1';

    Problem still remains.....should I let these changes remain or revert ?

  • peregrineperegrine MVP
    edited July 2014
             # RewriteBase /enjoy
    

    remove the # so it is not a comment.

    RewriteBase /enjoy

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

  • Thanks. Did that .. no go...

    Also, the .htaccess file of the working forum did not change/ comment out this line so that does not seem to be the cause...

    ( BTW, did I say I was nooooo :-) )

  • NooNoo New
    edited July 2014

    Hi !

    Following instructions on

    http://vanillaforums.org/docs/installation-upgrade

    I added this statement to my config.php file ( at the very end ) ,

    $Configuration['Debug'] = TRUE;

    and now get this error message when Guest Permissions are set to null ( nothing allowed for Guests )

    Fatal Error in PHP.trigger_error();
    Gdn_SQL->ConditionExpr(VALUE, ARRAY) is deprecated. Use Gdn_SQL->ConditionExpr(VALUE, VALUE) instead.
    The error occurred on or near: /home/mytopjob/public_html/getjoy/enjoy/library/core/functions.general.php
    
    703:       $Msg = $Name.' is deprecated.';
    704:       if ($NewName)
    705:          $Msg .= " Use $NewName instead.";
    706: 
    707:       trigger_error($Msg, E_USER_DEPRECATED);
    708:    }
    709: }
    710: 
    711: if (!function_exists('ExternalUrl')) {
    
    Backtrace:
    
    /home/mytopjob/public_html/getjoy/enjoy/library/core/functions.general.phpPHP::Gdn_ErrorHandler();
    [/home/mytopjob/public_html/getjoy/enjoy/library/core/functions.general.php:707] PHP::trigger_error();
    [/home/mytopjob/public_html/getjoy/enjoy/library/database/class.sqldriver.php:314] PHP::Deprecated();
    [/home/mytopjob/public_html/getjoy/enjoy/library/database/class.sqldriver.php:1962] Gdn_SQLDriver->ConditionExpr();
    [/home/mytopjob/public_html/getjoy/enjoy/applications/vanilla/models/class.discussionmodel.php:324] Gdn_SQLDriver->Where();
    [/home/mytopjob/public_html/getjoy/enjoy/applications/vanilla/controllers/class.discussionscontroller.php:136] DiscussionModel->GetWhere();
    [/home/mytopjob/public_html/getjoy/enjoy/applications/vanilla/controllers/class.discussionscontroller.php:136] DiscussionsController->Index();
    [/home/mytopjob/public_html/getjoy/enjoy/library/core/class.dispatcher.php:350] PHP::call_user_func_array();
    [/home/mytopjob/public_html/getjoy/enjoy/index.php:46] Gdn_Dispatcher->Dispatch();
    
    Variables in local scope:
    [Name] 'Gdn_SQL->ConditionExpr(VALUE, ARRAY)'
    [NewName] 'Gdn_SQL->ConditionExpr(VALUE, VALUE)'
    [Msg] 'Gdn_SQL->ConditionExpr(VALUE, ARRAY) is deprecated. Use Gdn_SQL->ConditionExpr(VALUE, VALUE) instead.'
    

    Also, below the Edit Role screen in my Dashboard, logging in as admin , I see the following

    Debug Trace -
    
    Info Need to re-index theme cache
    Info    Need to re-index plugin cache  
    

    Hope above are of some help in resolving this issue. Please advise

  • The debug trace about re-indexing the caches is only applicable to your set up if you have a cache set up (you would know if you do).

    The other issue has to do with deprecation. This means the function call was marked to be removed in a future release. The debug mode picks up on this and spits it out.

    The actual error in this case seems to be just below that on line 306 of file /library/database/class.sqldriver.php. Since the called $Value is an array AND the $EscapeValueSql is true, it throws an error.

    Assuming you have a stock install, I think this is a bug.

    Do a fresh install of 2.1. Set your permissions like you do now. See if you still get the error.

    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.

  • I think I will do a fresh install...how do I save the present users, posts, comments, likes etc.... ?

  • @Noo‌

    Almost all the 'good stuff' is in the database. If your users have uploaded profile images you would also want to copy over the uploads folder.

    Create a fresh install with a new database.

    Check the install is working how you would like/expect.

    Change the config.php in the new install to point to your old database.

    Delete the ini files in the cache folder.

    Copy over the uploads folder if needed.

    That should be it.

  • Hi !

    As of now this is what I did -

    • Uploaded Vanilla 2.1 Core files in existing vanilla folder, asking it to overwrite any files with same name already there.

    It seems to be working now, the site connects to my existing Database with existing images, posts, users, themes, plugins and applications showing up.......

    Setting Guests permission to nothing I no longer get that " Whoops " page I was getting earlier. Guests no more get any discussion links to click on

    So this seems to be resolved - thanks much to all who contributed to this thread and made helpful suggestions,

Sign In or Register to comment.