Sugar Bean Override Not Working

Hello Folks,

I am trying to override sugar bean for Leads module and somehow it is not working as expected. I did the same override for Cases and it worked well. Also, I have found out that this problem is coming if we have controller.php file in module directory. I tried overriding that as well but no luck.

Any help would be very much appreciated.

Just in case, if you want to review what I have done so far,

require_once("modules/Leads/Lead.php");

class CustomLead extends Lead {

public function __construct() {

parent::__construct();

}

}

Regards,

Hats

Parents
  • Hi 

    You need to create an extended include (custom/Extension/application/Ext/Include/<somescript.php>) and add a code like that:

    <?php

    $objectList['Leads'] = 'Lead';
    $beanList['Leads'] = 'CustomLead';
    $beanFiles['CustomLead'] = 'custom/modules/Leads/Lead.php';

    Then you have to create the script custom/modules/Leads/Lead.php. Inside this script you have to create the class CustomLead which inherit from regular Lead. Lastly you can override the method you want to.

    After doing all these tasks go to Admin -> Repair -> Quick Repair and Rebuild.

    Kind regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply
  • Hi 

    You need to create an extended include (custom/Extension/application/Ext/Include/<somescript.php>) and add a code like that:

    <?php

    $objectList['Leads'] = 'Lead';
    $beanList['Leads'] = 'CustomLead';
    $beanFiles['CustomLead'] = 'custom/modules/Leads/Lead.php';

    Then you have to create the script custom/modules/Leads/Lead.php. Inside this script you have to create the class CustomLead which inherit from regular Lead. Lastly you can override the method you want to.

    After doing all these tasks go to Admin -> Repair -> Quick Repair and Rebuild.

    Kind regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children