0

I added a custom module to a fresh install of magento on my local (mac). Since setting this up I needed to add the site to another computer (kubuntu).

On the kubuntu I cloned the git repository and the site works as expected but if I view pages belonging to the module it returns a 404.

Both the mac and kubuntu have identical database and code.

Unless someone thinks it's necessary i'm not going to post the code for the module because I can't see that being an issue given that it works on the mac. I assume this has to be a config issue somewhere but where?

config.xml

   <?xml version="1.0" encoding="UTF-8"?>


 <config> 

<modules>

    <Graphicalliance_Dynamicblocks>
        <version>0.0.1</version>
    </Graphicalliance_Dynamicblocks>

</modules>
<frontend>
    <routers>
        <Dynamicblocks>
            <use>standard</use>
            <args>
                <module>Graphicalliance_Dynamicblocks</module>
                <frontName>Dynamicblocks</frontName>
            </args>
        </Dynamicblocks>
    </routers>

    <layout>
        <updates>
            <graphicalliance_dynamicblocks>
                <file>dynamicblocks.xml</file>
            </graphicalliance_dynamicblocks>
        </updates>
    </layout>
</frontend>
<global>

</global>
</config>

Url to index action is http://edwardgreen.localhost/shop/Dynamicblocks/index

root to this is release-head/shop/app/code/local/GraphicAlliance/Dyanmicblocks/controllers/IndexController.php

3
  • Paste (at least some of) your module's config.xml. – benmarks Mar 27 '14 at 17:04
  • And let's see the magento-root-relative path to your controller file along with the URL. – benmarks Mar 27 '14 at 17:21
  • i added more info, if it's not what you meant please let me know – develophper Mar 27 '14 at 17:26
2

Unless you set it up otherwise, your Mac filesystem is case-insensitive. The most likely culprit in this instance is incorrect casing, whether due to config paths and values or due to class group notation. There may also be incorrect casing in your folder or file names.

Based on your edit:

app/code/local/GraphicAlliance/Dyanmicblocks/controllers/IndexController.php
                      ^
                      |
                      --------- That's your problem.

In your configuration your module is named Graphicalliance_Dynamicblocks, but your filesystem StudlyCases the namespace folder GraphicAlliance. You will need to settle on one or the other and use it consistently.

***NB: git will complain mercilessly if you have conflicting casing present in different filesystems. I suggest you either edit your config to use StudlyCase or you use git to move:

git mv app/code/local/GraphicAlliance/ app/code/local/Graphicalliance/

should do the trick, but I'll defer to others.

3
  • Hi benmarks and thanks for the answer. I added the config.xml. I'll check again but I don't think there are any casing issues. Also, just to be clear, it works on the mac but not the kubuntu. – develophper Mar 27 '14 at 17:11
  • try it with a lowercase frontName value, i.e. Dynamicblocks. – benmarks Mar 27 '14 at 17:17
  • that didn't work unfortunately. If there's any other part of the module that you want to see feel free to ask. I just didn't post it because I assume it wasn't necessary – develophper Mar 27 '14 at 17:19
0

Try making the module name under <routers> lowercase.

<routers>
    <dynamicblocks>
        <use>standard</use>
        <args>
            <module>Graphicalliance_Dynamicblocks</module>
            <frontName>Dynamicblocks</frontName>
        </args>
    </dynamicblocks>
</routers>
1
  • This is simply a handle which is referenced in code and full action name layout update handles. It is worth noting that it would be lowercased for layout XML full action name handle. – benmarks Mar 27 '14 at 19:16
0

...I would go for a lowercase frontName as well as the lowercase definition 'dynamicblocks' after 'routers'.

I would also go for 'GraphicAlliance' for your company name as when you add more modules and code you really will this to be 'right'. Having some camelcase for that is no problems when it comes to unexpected debug problems. As for the module name, stick with 'Dynamicblocks' without a capital 'B' in it as that will make things easier with where you are now.

Once you have a consistent naming convention sorted future development will be a lot easier than what you have now.

Then there are the basics:

You also have to make sure that the cache is absolutely clean, as in remove everything in var/cache/* and var/session/*. Clearing the cache and login/logout is needed for modules.

File permissions count too, make sure your module is on 755/644 or 775/664 depending on how you have your apache groups and permissions set up.

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.