2

I'm having trouble overriding Bronto community extension (common module) on Magento. My custom classes are not being used, so I suspect there's something wrong with my configuration.

Here's what my shop/etc/modules/Bronto_All.xml looks like:

<?xml version="1.0"?>
<config>
    <modules>
    <Me_Bronto_Common>
        <active>true</active>
        <codePool>local</codePool>
        <depends>
            <Bronto_Common/>
        </depends>
    </Me_Bronto_Common>
    </modules>
</config>

Here's what my local/Me/Bronto/Common/etc/config.xml looks like:

<?xml version="1.0"?>
<config>
<modules>
    <Me_Bronto_Common>
        <version>1.0.0</version>
    </Me_Bronto_Common>
</modules>
<global>
    <models>
        <bronto_common>
          <rewrite>
              <email_template>Me_Bronto_Common_Model_Email_Template</email_template>
              <system_config_source_related>Me_Bronto_Common_Model_System_Config_Source_Related</system_config_source_related>
          </rewrite>
        </bronto_common>
    </models>
</global>

Here's what my local/Me/Bronto/Common/Model/Email/Template.php looks like:

<?php
class Me_Bronto_Common_Model_Email_Template extends Bronto_Common_Model_Email_Template
{
      public function send($email, $name = null, array $variables = array())
      {
        //some code
      }
}

Here's what my local/Me/Bronto/Common/Model/System/Config/Source/Related.php looks like:

<?php
class Me_Bronto_Common_Model_System_Config_Source_Related extends  Bronto_Common_Model_System_Config_Source_Related
{
      public function toOptionArray($isMultiselect = null)
     { 
      // some code
      }
}

Can anyone tell if something is wrong or missing from the configuration above? Thanks.


Here's the core Bronto config.xml file:

<?xml version="1.0"?>
    <config>
    <modules>
        <Bronto_Common>
        <version>2.3.0</version>
    </Bronto_Common>
</modules>
<global>
    <blocks>
        <bronto_common>
            <class>Bronto_Common_Block</class>
        </bronto_common>
    </blocks>
    <helpers>
        <bronto_common>
            <class>Bronto_Common_Helper</class>
        </bronto_common>
    </helpers>
    <models>
        <bronto_common>
            <class>Bronto_Common_Model</class>
            <resourceModel>bronto_common_mysql4</resourceModel>
        </bronto_common>
        <bronto_common_mysql4>
          <class>Bronto_Common_Model_Mysql4</class>
          <entities>
              <api>
                  <table>bronto_common_api</table>
              </api>
              <error>
                  <table>bronto_common_api_errors</table>
              </error>
              <queue>
                  <table>bronto_common_api_send_queue</table>
              </queue>
          </entities>
        </bronto_common_mysql4>
    </models>
    <resources>
        <bronto_common_setup>
            <setup>
                <module>Bronto_Common</module>
                <class>Bronto_Common_Model_Resource_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </bronto_common_setup>
    </resources>
</global>
<frontend>
    <layout>
        <updates>
            <bronto_common>
                <file>bronto/common.xml</file>
            </bronto_common>
        </updates>
    </layout>
    <routers>
        <bronto_common>
            <use>standard</use>
            <args>
                <module>Bronto_Common</module>
                <frontName>bronto</frontName>
            </args>
        </bronto_common>
    </routers>
</frontend>
<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <bronto_common before="Mage_Adminhtml">Bronto_Common_Adminhtml</bronto_common>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
<adminhtml>
    <layout>
        <updates>
            <bronto_common>
                <file>bronto/common.xml</file>
            </bronto_common>
        </updates>
    </layout>
    <events>
        <bronto_disable>
            <observers>
                <bronto_common_disable>
                    <class>bronto_common/observer</class>
                    <method>watchDisableAction</method>
                </bronto_common_disable>
            </observers>
        </bronto_disable>
        <controller_action_predispatch>
            <observers>
                <bronto_common_controller_action_predispatch>
                    <class>bronto_common/observer</class>
                    <method>checkBrontoRequirements</method>
                </bronto_common_controller_action_predispatch>
            </observers>
        </controller_action_predispatch>
        <controller_action_predispatch_adminhtml>
            <observers>
                <bronto_common_registration_form_submit>
                    <class>bronto_common/observer</class>
                    <method>registerExtension</method>
                </bronto_common_registration_form_submit>
            </observers>
        </controller_action_predispatch_adminhtml>
    </events>
</adminhtml>
<default>
    <bronto>
        <settings>
            <enabled>1</enabled>
            <debug>1</debug>
            <log_threshold>30</log_threshold>
            <clear_logs>1</clear_logs>
            <verbose>0</verbose>
            <test>0</test>
            <notices>0</notices>
        </settings>
        <format>
            <image_type>small_image</image_type>
            <image_width>88</image_width>
            <image_height>77</image_height>
            <default_greeting>Valued Customer</default_greeting>
            <default_greeting_prefix></default_greeting_prefix>
            <default_greeting_firstname></default_greeting_firstname>
            <default_greeting_lastname></default_greeting_lastname>
        </format>
        <support>
            <registered>0</registered>
            <using_solution_partner>1</using_solution_partner>
        </support>
    </bronto>
    <bronto_popup>
        <settings>
            <subscribe>0</subscribe>
        </settings>
    </bronto_popup>
    <bronto_api>
        <settings>
            <enabled>0</enabled>
            <mage_cron>1</mage_cron>
            <frequency>I</frequency>
            <interval>5</interval>
            <minutes>0</minutes>
            <limit>50</limit>
            <threshold>5</threshold>
        </settings>
        <queue_settings>
            <enabled>0</enabled>
            <mage_cron>1</mage_cron>
            <frequency>I</frequency>
            <interval>5</interval>
            <minutes>0</minutes>
            <limit>50</limit>
        </queue_settings>
        <soap_options>
            <soap_client>Bronto_SoapClient</soap_client>
            <observer>Bronto_Common_Model_Api</observer>
            <retryer>Bronto_Common_Model_Error</retryer>
            <stream_context>0</stream_context>
            <retry_limit>2</retry_limit>
            <trace>0</trace>
            <exceptions>1</exceptions>
            <connection_timeout>30</connection_timeout>
            <cache_wsdl>WSDL_CACHE_BOTH</cache_wsdl>
        </soap_options>
    </bronto_api>
</default>
<crontab>
    <jobs>
        <bronto_common_errors>
            <run>
                <model>bronto_common/observer::processApiErrors</model>
            </run>
        </bronto_common_errors>
        <bronto_common_queue>
            <run>
                <model>bronto_common/observer::processSendQueue</model>
            </run>
        </bronto_common_queue>
        <bronto_common_delete_archives>
            <schedule>
                <cron_expr>0 0 * * *</cron_expr>
            </schedule>
            <run>
                <model>bronto_common/observer::clearArchives</model>
            </run>
        </bronto_common_delete_archives>
        <bronto_common_delete_old_logs>
            <schedule>
                <cron_expr>0 0 * * *</cron_expr>
            </schedule>
            <run>
                <model>bronto_common/observer::clearOldLogs</model>
            </run>
        </bronto_common_delete_old_logs>
    </jobs>
</crontab>
<phpunit>
    <suite>
        <modules>
            <Bronto_Common/>
        </modules>
    </suite>
</phpunit>
</config>
  • Have you tried placing your files in app/code/local/Me/BrontoCommon/ instead of app/code/local/Me/Bronto/Common/. I am not sure how Magento handles three-deep folders in modules. Everything I see and use is two-deep folders in modules. – Joseph at SwiftOtter Aug 18 '15 at 18:07
  • Thanks for the suggestion Joseph. Just tried using a two-deep structure but still didn't work. Magento is still calling the community version. – anonrabbit87 Aug 18 '15 at 18:29
  • Have you disabled all caches? – Joseph at SwiftOtter Aug 18 '15 at 19:26
  • Yes, all caches are disabled on my local machine – anonrabbit87 Aug 18 '15 at 19:52
1

Try changing your naming convention

/etc/modules/Me_BrontoCommon.xml

<?xml version="1.0"?>
<config>
    <modules>
    <Me_BrontoCommon>
        <active>true</active>
        <codePool>local</codePool>
        <depends>
            <Bronto_Common/>
        </depends>
    </Me_BrontoCommon>
    </modules>
</config>

local/Me/BrontoCommon/etc/config.xml

<?xml version="1.0"?>
<config>
<modules>
    <Me_BrontoCommon>
        <version>1.0.0</version>
    </Me_BrontoCommon>
</modules>
<global>
    <models>
        <mybrontocommon>
            <class>Me_BrontoCommon_Model</class>
        <brontocommon>
        <mybronto_common>
          <rewrite>
              <email_template>Me_BrontoCommon_Model_Email_Template</email_template>
              <system_config_source_related>Me_BrontoCommon_Model_System_Config_Source_Related</system_config_source_related>
          </rewrite>
        </bronto_common>
    </models>
</global>

Here's what my local/Me/BrontoCommon/Model/Email/Template.php

<?php
class Me_BrontoCommon_Model_Email_Template extends Bronto_Common_Model_Email_Template
{
      public function send($email, $name = null, array $variables = array())
      {
        //some code
      }
}

local/Me/BrontoCommon/Model/System/Config/Source/Related.php

<?php
class Me_BrontoCommon_Model_System_Config_Source_Related extends  Bronto_Common_Model_System_Config_Source_Related
{
      public function toOptionArray($isMultiselect = null)
     { 
      // some code
      }
}
  • Thank you, but it's still not working =( – anonrabbit87 Aug 18 '15 at 20:48
  • Can you add the config.xml from Bronto – Renon Stewart Aug 18 '15 at 20:52
  • R.S. done (see above) – anonrabbit87 Aug 18 '15 at 20:59
  • Check to make sure your module is enable in system -> config -> advance – Renon Stewart Aug 18 '15 at 21:00
  • Yes, they are enabled. Still not working though. – anonrabbit87 Aug 18 '15 at 21:31

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.