Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento - Mage::getModel not working on Linux server

Tags:

module

magento

I'm struggling with an issue for which I can't find an explanation. I have two development environments that I use for my projects. I created a simple module for Magento and I tested it on one environment. After overcoming all Magento's complications, the module works as expected. This is on XAMPP.

I then copied the module to the development Linux environment, on a hosted server, and it crashes miserably. I did some debugging, and I found out that a call to Mage::getModel() returns bool(false) instead of the instance of the Model I requested.

I double checked all files and directories, and they match. Database is not involved (not from my side, at least, I don't need tables) and both environments have only me as a User, with Admin permissions.

Any suggestion on where should I start looking is welcome, thanks.

Added on 2012/07/09
Model contains a class named Diego_ClientCustomModule_Model_ExternalUserData, which is invoked with $model = Mage::getModel('clientcustommodule/externaluserdata');. Model file resides in Diego_ClientCustomModule\code\local\Diego\ClientCustomModule\Model\. The curious thing is:

  • If model file is named Externaluserdata.php, it works.
  • If model file is named ExternalUserData.php (i.e. it matches the class name), it doesn't work.

I'm aware of case sensitivity stuff etc, but, if the alias is all lower-case, how comes it can load a file having the first letter capitalized?

Configuration file 0.1.0 Diego_ClientCustomModule_Helper Diego_ClientCustomModule_Model Diego_ClientCustomModule_Block standard Diego_ClientCustomModule ClientCustomModule

like image 894
Diego Avatar asked Feb 20 '23 22:02

Diego


1 Answers

Snarking about the framework for which you are asking for help may not be the best strategy for receiving help.

Your issue is likely one of cache (remove var/cache folder to check) or one of improper casing. Note that the first letter of each directory and filename for files loaded by the autoloader (blocks, models, and helpers).

like image 200
benmarks Avatar answered Feb 23 '23 00:02

benmarks