AnsweredAssumed Answered

Error when editing records in custom module

Question asked by mike zenns on Mar 27, 2014
Latest reply on May 21, 2014 by Harald Kuske
I built a custom module to house service locations for our customers, but now after adding and removing a few fields I get the following error when attempting to edit a location:

Warning: Missing argument 1 for servs_provided_servicesController::action_editview(), called in /var/www/sugar/include/MVC/Controller/SugarController.php on line 362 and defined in /var/www/sugar/custom/modules/servs_provided_services/controller.php on line 3
Warning: Missing argument 2 for servs_provided_servicesController::action_editview(), called in /var/www/sugar/include/MVC/Controller/SugarController.php on line 362 and defined in /var/www/sugar/custom/modules/servs_provided_services/controller.php on line 3

Warning: Missing argument 3 for servs_provided_servicesController::action_editview(), called in /var/www/sugar/include/MVC/Controller/SugarController.php on line 362 and defined in /var/www/sugar/custom/modules/servs_provided_services/controller.php on line 3

The files referred to in the error:

/var/www/sugar/custom/modules/servs_provided_services/controller.php
 <?
class servs_provided_servicesController extends SugarController { 
    function action_editview(&$bean,$event,$arguments) { 
require_once('modules/Accounts/Account.php'); 

        $account = new Account(); 
        $account->retrieve($bean->account_id); 
        $this->bean->phone_office_c = $account->phone_office_c; 
    } 
}  

?>

The relevant section of /var/www/sugar/include/MVC/Controller/SugarController.php:

/**
  * Perform the specified action. 
  * This can be overridde in a sub-class
  */

private function do_action(){
  $function =  'action_'. strtolower($this->do_action);
  if($this->hasFunction($function)){
   $GLOBALS['log']->debug('Performing action: '.$function.' MODULE: '.$this->module); 
   $this->$function();
   return true;
  }
  return false;
}


I think the cause of the errors may also be why my attempts to upgrade beyond V. 5.2 on Debian Lenny have been unsuccessful.

Any ideas on how to fix this?

Outcomes