1

I created a new custom module on my magento 1.9 website. After I installed it I got this error on my system.log file: Warning: include(Cm/Cache/Backend/Redis.php): failed to open stream: No such file or directory, and from that moment my magento admin panel displays only a blank page, without any errors, o console errors. I don't know what happened. I had only a few files in my modules: config.xml

<config>
<modules>
    <Blugento_AdminChat>
        <version>1.0.0</version>
    </Blugento_AdminChat>
</modules>
<global>
    <helpers>
        <blugento_adminchat>
             <class>Blugento_AdminChat_Helper</class>
        </blugento_adminchat>
    </helpers>
</global>
<adminhtml>
    <acl>
        <resources>
            <all>
                 <title>Allow Everything</title>
            </all>
            <admin>
                 <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <adminchat>
                                        <title>AdminChat</title>
                                    </adminchat>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>
</config>

footer.phtml this will overwrite the footer from the magento admin panel and will add the last to scripts from the bottom of the file:

<p class="bug-report">
     <a href="<?php echo $this->getBugreportUrl() ?>" id="footer_bug_tracking"><?php echo $this->__('Help Us Keep Magento Healthy - Report All Bugs') ?></a><br/>
     <?php echo $this->__('Interface Locale: %s', $this->getLanguageSelect()) ?>
</p>
<p class="legality">
     <a href="<?php echo $this->getConnectWithMagentoUrl() ?>" id="footer_connect"><?php echo $this->__('Connect with the Magento Community') ?></a><br/>
     <img src="<?php echo $this->getSkinUrl('images/varien_logo.gif') ?>" class="v-middle" alt="" />&nbsp;&nbsp;
     <?php echo $this->__('Magento&trade; is a trademark of Magento Inc.<br/>Copyright &copy; %s Magento Inc.', date('Y')) ?>
</p>
<?php echo $this->__('Magento ver. %s', Mage::getVersion()) ?>
<script type="text/javascript">
     $('footer_bug_tracking').target = 'Varien_External';
     $('footer_connect').target = 'Varien_External';
     function setInterfaceLanguage(evt){
     var elem = Event.element(evt);
     if(elem){
        setLocation('<?php echo $this->getChangeLocaleUrl() ?>locale/'elem.value'/<?php echo $this->getRefererParamName() ?>/<?php echo $this->getUrlForReferer() ?>');
     }
}
Event.observe('interface_locale', 'change', setInterfaceLanguage)
</script>
<?php if(Mage::helper('blugento_adminchat')->isEnabled() && Mage::helper('blugento_adminchat')->getEmail()):?>
<script>
    window.intercomSettings = {
        app_id: "<?php echo Mage::getStoreConfig('blugento_adminchat/general/app_id'); ?>",
        name: "<?php echo Mage::getSingleton('admin/session')->getUser()->getName(); ?>", // Full name
        email: "<?php echo Mage::helper('blugento_adminchat')->getEmail(); ?>", // Email address
        created_at: "<?php echo Mage::getStoreConfig('blugento_adminchat/general/customer_since'); ?>", // Signup Date
        shop_url: "<?php echo Mage::helper('blugento_adminchat')->getDomain(); ?>",
        shop_code: "<?php echo Mage::getStoreConfig('blugento_adminchat/general/shop_code'); ?>",
        user_hash: "<?php
            echo hash_hmac(
                'sha256', // hash function
                Mage::helper('blugento_adminchat')->getEmail(), // user's email address
                'zIHDTOn6oDiZNrdb_qRRMoO-oLNEg-yeubFZ5sU1' // secret key (keep safe!)
            );
            ?>"
    };
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/fmjefzxq';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()
</script>
<?php endif; ?>

And the last file is Data.php from helper folder:

class Blugento_Adminchat_Helper_Data extends Mage_Core_Helper_Abstract
{
const XML_PATH_ENABLED = 'blugento_adminchat/general/enable';

/**
 * Check if module is enabled
 *
 * @return int
 */
public function isEnabled()
{
    return (int) Mage::getStoreConfig(self::XML_PATH_ENABLED);
}

public function getEmail(){

    $user = Mage::getSingleton('admin/session');
    $userEmail = $user->getUser()->getEmail();

    $authorizedEmails = Mage::getStoreConfig('blugento_adminchat/general/authorized_external_emails');
    $authorizedEmails = explode(',', $authorizedEmails);

    foreach($authorizedEmails as $key => $email){
        $email = trim($email);
        $authorizedEmails[$key] = $email;
    }

    if($this->checkEmail($userEmail) || in_array($userEmail, $authorizedEmails)){
        return $userEmail;
    }else{
        return false;
    }
}

public function getDomain(){
    $domain = Mage::getBaseUrl (Mage_Core_Model_Store::URL_TYPE_WEB);

    $domain = str_replace('http://', '', $domain);
    $domain = str_replace('https://', '', $domain);
    $domain = str_replace('www.', '', $domain);
    if($domain[strlen($domain)-1] == '/'){
        $domain = substr($domain, 0, -1);
    }
    return $domain;
}

public function checkEmail($email){
    $domains = array('domain.ro', 'domain.eu');

    $domain = $this->getDomain();
    $email = trim($email);

    $emailDomain = explode('@', $email);
    $emailDomain = $emailDomain[count($emailDomain)-1];

    if($emailDomain == $domain  && !in_array($emailDomain, $domains)){
        return true;
    }else{
        return false;
    }
  }
}

And the other two files are system.xml and Adminchat.xml, but I think these two are not relevant. Can anyone tell me if the code is wrong and how to make my magento admin panel to work again, because now I can't access it. I deleted the cache and don't know what else to do now. Can you help please?

1

At least your config.xml is a bit messed up.

AdminChat is not a valid module name (module names must be of a structure like Vendor_Module - i.e. Blugento_AdminChat could be working for you, based on the helper class you gave).

Apart from that you're calling your helper with Mage::helper('blugento_adminchat') when in your config.xml the helper alias is set as adminchat. Also, the helper class definition is not correct (AdminChat_Helper should rather be Blugento_AdminChat_Helper).

So, for your config.xml something like this should fit better:

<config>
<modules>
    <Blugento_AdminChat>
        <version>1.0.0</version>
    </Blugento_AdminChat>
</modules>
<global>
    <helpers>
        <blugento_adminchat>
            <class>Blugento_AdminChat_Helper</class>
        </blugento_adminchat>
    </helpers>
</global>
<adminhtml>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <adminchat>
                                        <title>AdminChat</title>
                                    </adminchat>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>
</config>
  • I made this changes, but this was not the problem, the problem is still here...Do you have any other idea? – Ciprian Feb 8 '18 at 6:34
  • @Ciprian first of all please disable your module from app/etc/modules/... and figure out whether there is an actual relation between your module and the error (don't forget to clear your caches). If so, please post your full current state of the module. – Christoph Farnleitner Feb 8 '18 at 9:00
0

I had this same issue and turns out flushing the redis cache fix it for me.

From command line:

echo 'flushall' | redis-cli -s /path/to/sock

Heres the documentation incase you're not using a socket:

https://briansnelson.com/Install_Redis_Caching_for_Magento

Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.