cancel
Showing results for 
Search instead for 
Did you mean: 

Magento module working local but not on server

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Magento module working local but not on server

Hello,

 

I've written for Magento 1.9.x a custom module. Local it is workin great, but it's not being loaded on the server... it look like the module is not loaded.

I want to override customer AccountController and Helper/Data from customer.

Can anyone find an error in the files? Thanks!

 

I already cleared cache in magento and in /var/cache but with no effect

This are my Files:

 

/app/etc/modules/Org_RestLogin.xml

<?xml version="1.0"?> 
<config>
    <modules>
         <Org_RestLogin>
              <active>true</active> 
              <codePool>local</codePool> 
              <depends>
                  <Mage_Customer /> <!-- Make sure, this is loaded first -->
              </depends>
         </Org_RestLogin>
    </modules>
 </config>

/app/code/local/org/RestLogin/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Org_RestLogin>
            <version>1.1.1</version>
        </Org_RestLogin>
    </modules>

    <frontend>
        <routers>
            <customer>
                <args>
                    <modules>
                        <org_restlogin before="Mage_Customer">Org_RestLogin</org_restlogin>
                    </modules>
                </args>
            </customer>
        </routers>
    </frontend>

    <global>
       <helpers>
          <customer>
              <rewrite>
                  <data>Org_RestLogin_Customer_Helper_Data</data>
             </rewrite>
          </customer>
       </helpers>
    </global>
</config>

/app/code/local/org/RestLogin/controllers/AccountController.php

<?php
require_once 'Mage/Customer/controllers/AccountController.php';

class Org_RestLogin_AccountController extends Mage_Customer_AccountController {
    //my custom methods
}

/app/code/local/org/RestLogin/Customer/Helper/Data.php

<?phpclass Org_RestLogin_Customer_Helper_Data extends Mage_Customer_Helper_Data
{
    /**
     * Check whether customers registration is allowed
     *
     * @return bool
     */
    public function isRegistrationAllowed() {
        return false;
    }
}
2 REPLIES 2

Re: Magento module working local but not on server

Hi @kronos88

 

I think you developed your module on windows localhost. and once you deployed on the Linux server you are facing issues.

 

By seeing the following lines in your code:

1)

/app/code/local/org/RestLogin/etc/config.xml

 

/app/code/local/org/RestLogin/controllers/AccountController.php

 

/app/code/local/org/RestLogin/Customer/Helper/Data.php

 

I recommend you to use Org as directory name instead on org. Because Linux is case sensitive.

 

2) 

<?phpclass Org_RestLogin_Customer_Helper_Data extends Mage_Customer_Helper_Data

change the above code to 

<?php
class Org_RestLogin_Customer_Helper_Data extends Mage_Customer_Helper_Data

Please do the above mentioned and see if it works for you.

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Magento module working local but not on server

Hi @Mukesh Tiwari,

 

sorry, both are typos... folder name is /Org/ and the <?php is also like in your post.

Module is developed on OS X and deployed on Linux server.

I think that there is a permission problem on the server or magento cached my module very hard...

 

I will try to check permissions and if this doesn't work, I will create a new extension with different name.