0

My custom module, defined with Mariu's Ultimate Module Creator extension works fine in local, but it doesn't seem to find the controller when uploaded to web host (both are linux).

The config.xml file looks like this:

    <config>
<modules>
    <Mycompany_FractionSlider>
        <version>0.0.1</version>
    </Mycompany_FractionSlider>
</modules>
<global>
    <resources>
        <mycompany_fractionslider_setup>
            <setup>
                <module>Mycompany_FractionSlider</module>
                <class>Mycompany_FractionSlider_Model_Resource_Setup</class>
            </setup>
        </mycompany_fractionslider_setup>
    </resources>
    <blocks>
        <fractionslider>
            <class>Mycompany_FractionSlider_Block</class>
        </fractionslider>
    </blocks>
    <helpers>
        <fractionslider>
            <class>Mycompany_FractionSlider_Helper</class>
        </fractionslider>
    </helpers>
    <models>
        <fractionslider>
            <class>Mycompany_FractionSlider_Model</class>
            <resourceModel>fractionslider_resource</resourceModel>
        </fractionslider>
        <fractionslider_resource>
            <class>Mycompany_FractionSlider_Model_Resource</class>
            <entities>
                <slider>
                    <table>fractionslider_slider</table>
                </slider>
                <slider_store>
                    <table>fractionslider_slider_store</table>
                </slider_store>
                <element>
                    <table>fractionslider_element</table>
                </element>
                <element_store>
                    <table>fractionslider_element_store</table>
                </element_store>
            </entities>
        </fractionslider_resource>
    </models>
</global>
<adminhtml>
    <layout>
        <updates>
            <fractionSlider>
                <file>mycompany_fractionslider.xml</file>
            </fractionSlider>
        </updates>
    </layout>
    <translate>
        <modules>
            <Mycompany_FractionSlider>
                <files>
                    <default>Mycompany_FractionSlider.csv</default>
                </files>
            </Mycompany_FractionSlider>
        </modules>
    </translate>
</adminhtml>
<admin>
    <routers>           
        <adminhtml>
            <args>
                <modules>
                    <Mycompany_FractionSlider before="Mage_Adminhtml">Mycompany_FractionSlider_Adminhtml</Mycompany_FractionSlider>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
<default>
    <fractionslider>
    </fractionslider>
</default></config>

And my layout file at: design/adminhtml/default/default/layout/mycompany_fractionslider.xml

<layout>
<!-- Sliders grid action -->
<adminhtml_fractionslider_slider_index>
    <reference name="menu">
        <action method="setActive">
            <menupath>fractionslider/slider</menupath>
        </action>
    </reference>
    <reference name="content">
        <block type="fractionslider/adminhtml_slider" name="slider" />
    </reference>
</adminhtml_fractionslider_slider_index>
<adminhtml_fractionslider_slider_grid>
    <block type="core/text_list" name="root" output="toHtml">
        <block type="fractionslider/adminhtml_slider_grid" name="slider_grid"/>
    </block>
</adminhtml_fractionslider_slider_grid>
<!-- Slider add/edit action -->
<adminhtml_fractionslider_slider_edit>
    <update handle="editor"/>
    <reference name="menu">
        <action method="setActive">
            <menupath>fractionslider/slider</menupath>
        </action>
    </reference>
    <reference name="content">
        <block type="fractionslider/adminhtml_slider_edit" name="slider_edit"></block>
    </reference>
    <reference name="left">
        <block type="fractionslider/adminhtml_slider_edit_tabs" name="slider_tabs"></block>
    </reference> 
</adminhtml_fractionslider_slider_edit>
<!-- Elements grid action -->
<adminhtml_fractionslider_element_index>
    <reference name="menu">
        <action method="setActive">
            <menupath>fractionslider/element</menupath>
        </action>
    </reference>
    <reference name="content">
        <block type="fractionslider/adminhtml_element" name="element" />
    </reference>
</adminhtml_fractionslider_element_index>
<adminhtml_fractionslider_element_grid>
    <block type="core/text_list" name="root" output="toHtml">
        <block type="fractionslider/adminhtml_element_grid" name="element_grid"/>
    </block>
</adminhtml_fractionslider_element_grid>
<!-- Element add/edit action -->
<adminhtml_fractionslider_element_edit>
    <update handle="editor"/>
    <reference name="menu">
        <action method="setActive">
            <menupath>fractionslider/element</menupath>
        </action>
    </reference>
    <reference name="content">
        <block type="fractionslider/adminhtml_element_edit" name="element_edit"></block>
    </reference>
    <reference name="left">
        <block type="fractionslider/adminhtml_element_edit_tabs" name="element_tabs"></block>
    </reference> 
</adminhtml_fractionslider_element_edit>

And then, the controller class at: app/code/local/Mycompany/FractionSlider/Controller/Adminhtml/FractionSlider.php

class Mycompany_FractionSlider_Controller_Adminhtml_FractionSlider extends Mage_Adminhtml_Controller_Action{
    ...
}

And the controller at: app/code/local/Mycompany/FractionSlider/controllers/Adminhtml/FractionSlider/SliderController.php

class Mycompany_FractionSlider_Adminhtml_FractionSlider_SliderController extends MyCompany_FractionSlider_Controller_Adminhtml_FractionSlider{
/**
 * init the slider
 * @access protected
 * @return Mycompany_FractionSlider_Model_Slider
 */
protected function _initSlider(){
    $sliderId  = (int) $this->getRequest()->getParam('id');
    $slider = Mage::getModel('fractionslider/slider');
    if ($sliderId) {
        $slider->load($sliderId);
    }
    Mage::register('current_slider', $slider);
    return $slider;
}
/**
 * default action
 * @access public
 * @return void
 * @author Ultimate Module Creator
 */
public function indexAction() {
    $this->loadLayout();
    $this->_title(Mage::helper('fractionslider')->__('FractionSlider'))
         ->_title(Mage::helper('fractionslider')->__('Sliders'));
    $this->renderLayout();
}

...

When I access the menu option for Sliders (or Elements) I get 404 error... I that only on the online server, not on my local machine.

1 Answer 1

2

Yeah...this is a known issue.
It happens when your module name has an upper case letter in it.
So everything works fine if you name your module Modulename, but it goes wrong on UNIX if your name it ModuleName. (notice the uppercase N).
The solutions for this are:
Option 1
Either your rebuild your full module and name it Mycompany_Fractionslider instead of Mycompany_FractionSlider. But if you already made some modifications on it this is not the best idea. So refer to option 2.
Option 2
Rename the file app/code/local/Mycompany/FractionSlider/controllers/Adminhtml/FractionSlider/SliderController.php to app/code/local/Mycompany/FractionSlider/controllers/Adminhtml/Fractionslider/SliderController.php (so FractionSlider becomes Fractionslider).
And app/code/local/Mycompany/FractionSlider/Controller/Adminhtml/FractionSlider.php to app/code/local/Mycompany/FractionSlider/Controller/Adminhtml/Fractionslider.php.

Also rename the classes inside those file according to the file name. SO FractionSlider becomes Fractionslider.

Leave the rest as it is and clear the cache.
If it's worth something this issue is fixed in this version. But that is not stable yet. I will be in a short time I hope.

3
  • Thanks!! many thanks! Great job with your extension although... still don't know if it can include a grid in a tab form... and would be great if it took default values for fields and could define select fields in admin forms and where to get the data from. But that's another question.
    – Jared
    Mar 27, 2014 at 13:31
  • @Jared. If you have any suggestions or if you find any bugs please add theme here. github.com/tzyganu/UMC1.9/issues. The version that you are using will be discontinued soon. (Actually it kind of already is because I haven't worked on it for some time). The new version already supports dropdown attributes and much more.
    – Marius
    Mar 27, 2014 at 13:41
  • just did ;) Anyway... once again, Great extension to save time to developers!
    – Jared
    Mar 27, 2014 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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