Unable to login to admin after logout from CMS. #8

Closed
sminnee opened this Issue Mar 31, 2012 · 1 comment

3 participants

@sminnee
SilverStripe Ltd. member

From http://open.silverstripe.org/ticket/6790

    [User Error] Uncaught Exception: Object->__call(): the method 'onmobiledomain' does not exist on 'Security'
    GET /Security/login?BackURL=%2Fadmin

    Line 724 in /data/www/ekyt/htdocs/sapphire/core/Object.php

    Source

    715                 
    716                 default :
    717                     throw new Exception (
    718                         "Object->__call(): extra method $method is invalid on $this->class:" . var_export($config, true)
    719                     );
    720             }
    721         } else {
    722             // Please do not change the exception code number below.
    723             
    724             throw new Exception("Object->__call(): the method '$method' does not exist on '$this->class'", 2175);
    725         }
    726     }
    727     
    728     // -----------------------------------------------------------------------------------------------------------------
    729     
    730     /**
    Trace

    Object->__call(onMobileDomain,Array) 
    Security->onMobileDomain() 
    Line 11 of MobileSiteTreeExtension.php
    MobileSiteTreeExtension->MetaTags(<meta name="generator" content="SilverStripe - http://silverstripe.org" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> ,,,,,,) 
    Line 963 of Object.php
    Object->extend(MetaTags,<meta name="generator" content="SilverStripe - http://silverstripe.org" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> ) 
    Line 1256 of SiteTree.php
    SiteTree->MetaTags(false) 
    call_user_func_array(Array,Array) 
    Line 693 of Object.php
    Object->__call(MetaTags,Array) 
    Page_Controller->MetaTags(false) 
    call_user_func_array(Array,Array) 
    Line 369 of ViewableData.php
    ViewableData->obj(MetaTags,Array,,1,) 
    Line 823 of ViewableData.php
    ViewableData_Customised->obj(MetaTags,Array,,1,) 
    Line 823 of ViewableData.php
    ViewableData_Customised->obj(MetaTags,Array,,1) 
    Line 446 of ViewableData.php
    ViewableData->XML_val(MetaTags,Array,1) 
    Line 39 of .cache.themes.blackcandy.templates.Page.ss
    include(/tmp/silverstripe-cache-data-www-eky-pratama.internetrix.net-htdocs/.cache.themes.blackcandy.templates.Page.ss) 
    Line 420 of SSViewer.php
    SSViewer->process(ViewableData_Customised) 
    Line 342 of ViewableData.php
    ViewableData->renderWith(Array) 
    Line 401 of Security.php
    Security->login(SS_HTTPRequest) 
    Line 193 of Controller.php
    Controller->handleAction(SS_HTTPRequest) 
    Line 143 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest) 
    Line 147 of Controller.php
    Controller->handleRequest(SS_HTTPRequest) 
    Line 282 of Director.php
    Director::handleRequest(SS_HTTPRequest,Session) 
    Line 125 of Director.php
    Director::direct(/Security/login) 
    Line 127 of main.php
@kmayo-ss

Unable to replicate this issue on 2.4 and 3.1 as it has been fixed and we can close the ticket.
The following commit would have fixed this problem as it added a hasMethod check to the controller instance so it checks to see if the method onMobileDomain exists before trying to call the method


Kirks-MacBook-Pro:mobile kmayo$ git show 2ecbb66a38da9e6326956e0beca2175521012696
commit 2ecbb66a38da9e6326956e0beca2175521012696
Author: Marijn Kampf <github.com@gwobbel.com>
Date:   Thu Dec 29 11:56:02 2011 +0000

    Fix for [User Error] Uncaught Exception: Object->__call(): the method 'onmobiledomain' does not exist on 'Security' occurred after new install of Silverstripe 2.4.5 and Silverstripe-Mobile.

diff --git a/code/MobileSiteTreeExtension.php b/code/MobileSiteTreeExtension.php
index e2e68c8..beeb2bf 100644
--- a/code/MobileSiteTreeExtension.php
+++ b/code/MobileSiteTreeExtension.php
@@ -8,7 +8,7 @@ class MobileSiteTreeExtension extends DataObjectDecorator {
                $config = SiteConfig::current_site_config();

                // Ensure a canonical link is placed, for semantic correctness and SEO
-               if(Controller::has_curr() && Controller::curr()->onMobileDomain() && $config->MobileSiteType == 'RedirectToDomain') {
+               if(Controller::has_curr() && Controller::curr()->hasMethod("onMobileDomain") && Controller::curr()->onMobileDomain() && $config->MobileSiteType == 'RedirectToDomain') {
                        $oldBaseURL = Director::baseURL();
                        Director::setbaseURL($config->FullSiteDomain);
                        $tags .= sprintf('<link rel="canonical" href="%s" />', $this->owner->AbsoluteLink()) . "\n";

@wilr wilr closed this Feb 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment