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.

Error 503 on page plugin

I got a little problem since I updated my forum to vanilla 2.1.10, I was getting an error on that plugin page only (503).
The error is not shown by a Vanilla page (not like 404).
So, I deactivated the plugin, removed it and downloaded the latest version.
But, I still have the error, so I checked in routing (redirection) and everything was looking normal. I get the same error with /plugin/MembersListEnh.
I checked the autorisation, and I have both (GenView and IPEmailView).
Everything else seems to work on the forum, just that page gives this error. Is anyone having an idea for a solution?

Comments

  • Did you delete the .ini files from the cache after removing the plugin and or installing the new one?

    A 503 error means that service is unavailable The Web server (running the Web site) is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server.

  • IntellIntell New
    edited May 2015

    Yes, I did delete it.
    It's strange because I don't think there is any overload of the server. It does it only on that page, the entire forum is running...

    Maybe it's a .htaccess issue or a server problem with that particular file, but I don't know where to look to be honest.

    Edit: Since visitors don't have privileges to see it, I check after logging off and I just get a blank page.

  • You need to set permissions to view for every role including Guest. I don't think peregrine included an error message in the plugin in the case that Guests would have some kind of access to the link since the link to that page does not appear to guests if they don't have permission to view.Which makes sense. So if a guest tries to be smart and tries to view that page , they get nothing but a blank...

    What I could do is add an error message with a link to go back to the forum.

    Find this section in the default.php of the plugin around line 71 and replace it with this code

    public function PluginController_MembersListEnh_Create($Sender) {
            $Session = Gdn::Session();
    
            if (($Sender->Menu) && ((CheckPermission('Plugins.MembersListEnh.GenView')) ||  (CheckPermission('Plugins.MembersListEnh.IPEmailView')))) {
                $Sender->ClearCssFiles();
                $Sender->AddCssFile('style.css');
                $Sender->MasterView = 'default';
    
                $Sender->Render('memtable', '', 'plugins/MembersListEnh');
            }else echo Wrap(Anchor(T('You have no Permission to View this Page Go Back'), '/discussions',array('target' => '_self')), 'h1');
        }
    
  • In case you don't want to deal with copy paste, just download the latest version of this plugin I just uploaded ...

  • IntellIntell New
    edited May 2015

    Oh, thank you! I like not to have to "maintain" myself minor modifications since it can become bigger and bigger management at the end.

    But if the user has the permission, the 503 error is still there.

    So, I did some test and I commented/uncommented the files till I don't have the 503 error.
    In "views/memtable.php", near line188, I have these lines:

     $Sender->Offset = ($Page * $Limit) - $Limit ;
     $Offset = $Sender->Offset;
    

    The problem doesn't seems to be the values passed, but the assignment.
    Since I'm not used to how things works in Vanilla, I don't really know what could be the cause.

    With a try/catch for these lines, I get that error: Creating default object from empty value.

    ....

    After a lot of debugging, I managed to make it work by adding that line ($Sender = new stdClass();):
    -in "views/memtable.php" near line 188

     $Sender = new stdClass();
     $Sender->Offset = ($Page * $Limit) - $Limit ;
     $Offset = $Sender->Offset;
    

    -in "class.memberslistenhmodel.php" near line 34

     $Sender = new stdClass();
     $Sender->UserData = $SQL->Limit($Limit, $Offset)->Get();
     RoleModel::SetUserRoles($Sender->UserData->Result());
    

    Now, what I want to know, is it correct to do that? Is there any possible issue?

  • I would not know if it would cause issues, I suppose if that solved it for you then go ahead and use it.

  • In fact, maybe the php version changed on my hosting, since I'm not the owner, I didn't received any message about. So, not related to Vanilla update I think.
    That error is triggered when you perform $Sender->Offset and $Sender is not yet initialized, which do not comply with E_Strict standards.

    Thank you for your help. ;)

Sign In or Register to comment.