2

I recently installed a clean version of Magento. I had a custom module what was working perfectly on the old one, but not on the new one(Both 1.9.2.1). It shows up under System->Configuration->Advanced->Advanced. When ever i try to call mydomain/index.php/cron. It will redirect to the 404 page. I tried to add the rest of the folders what are in tutorials : Block, Helper,model and sql. But no luck. As i said it is working on the older installation with the same version number. I just copied the whole module and the file to the etc folder.

Module structure:

  • code
    • local
      • Mxsxs2
        • Cron
          • controllers
            • IndexController.php
          • etc
            • config.xml
  • etc
    • modules
      • Mxsxs2_Cron.xml

Files:

app/code/local/Mxsxs2/Cron/etc/config.xml:

            <?xml version="1.0"?>
            <config>
               <modules>
                  <Mxsxs2_Cron>
                    <version>1.0.0</version>
                   </Mxsxs2_Cron>
               </modules>
               <frontend>
                   <routers>
                     <cron>
                        <use>standard</use>
                         <args>
                           <module>Mxsxs2_Cron</module>
                           <frontName>cron</frontName>
                         </args>
                     </cron>
                  </routers>
               </frontend>
            </config>

app/code/local/Mxsxs2/Cron/controllers/IndexController.php

<?php
class Mxsxs2_Cron_IndexController extends Mage_Core_Controller_Front_Action
{
    public $importfolder="var/import"; 
    private $errormessages=array();
    private $READ=null;
    private $WRITE=null;
    private $wasindb=0;
    private $noofwarehouses=3; //for cost check   
    public function indexAction(){
       echo("asd");
    }
    //----rest of the code and fucntions they are not important if i remove them it still does not work
}

app/etc/modules/Mxsxs2_Cron.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Mxsxs2_Cron>
            <active>true</active>
            <codePool>local</codePool>
        </Mxsxs2_Cron>
    </modules>
</config>
mxsxs2
  • 29
  • 1
  • http://stackoverflow.com/questions/576908/how-to-create-a-simple-hello-world-module-in-magento I tried the EXACT same module , which fails in Magento 1.9.2.1 but used ti run on all previous versions. – Pratik Joshi Aug 28 '15 at 10:28

2 Answers2

0

I have the latest Magento 1.9.x.x installed and had a similar problem. To debug it this question helps me a lot:Why is my Magento module not being loaded?. Basically you need to check Mage_Core_Model_Config. I also wonder why I can see my module in System->Configuration->Advanced->Advanced but it gives 404 error. Basically it's an error in Magento and the names for modules are broken. Somewhere Magento forces the names to have the first character Upper-case. It's not working with the first character lower-case (but it is shown in ystem->Configuration->Advanced->Advanced).

Community
  • 1
  • 1
Micromega
  • 12,486
  • 7
  • 35
  • 72
0

Try to change the frontName, it may make some conflicts with newer version of magento :

app/code/local/Mxsxs2/Cron/etc/config.xml:

        <?xml version="1.0"?>
        <config>
           <modules>
              <Mxsxs2_Cron>
                <version>1.0.0</version>
               </Mxsxs2_Cron>
           </modules>
           <frontend>
               <routers>
                 <cron>
                    <use>standard</use>
                     <args>
                       <module>Mxsxs2_Cron</module>
                       <frontName>testname</frontName>
                     </args>
                 </cron>
              </routers>
           </frontend>
        </config>

clear cache then access the url mydomain/index.php/testname

Attoui Ramzi
  • 131
  • 6