[Vtigercrm-commits] [vtiger development] #7259: Mobile extension: Calendar records return error

vtiger development vtiger-tickets at trac.vtiger.com
Fri Mar 9 03:55:10 PST 2012


#7259: Mobile extension: Calendar records return error
-----------------------+----------------------------------------------------
 Reporter:  joebordes  |        Owner:  developer
     Type:  defect     |       Status:  new      
 Priority:  critical   |    Milestone:  5.4.0    
Component:  vtigercrm  |      Version:  5.3.0    
 Severity:  High       |   Resolution:           
 Keywords:             |  
-----------------------+----------------------------------------------------
Comment (by prasad):

 In previous case-handling assumed the Events module to have ID 18... which
 isn't the case all the time.
 Here is a generic fix:

 {{{
         function cachedModuleLookupWithRecordId($recordId) {
                 $recordIdComponents = explode('x', $recordId);
                 $modules = $this->sessionGet('_MODULES'); // Should be
 available post login
                 foreach($modules as $module) {
                         if ($module->id() == $recordIdComponents[0]) {
 return $module; };
                 }

                 // Mobile API handles Calendar + Events as same.
                 $eventsModuleId =
 Mobile_WS_Utils::getEntityModuleWSId('Events');
                 if (strpos($recordId, $eventsModuleId) === 0) {
                         $calendarModuleId =
 Mobile_WS_Utils::getEntityModuleWSId('Calendar');
                         foreach($modules as $module) {
                                 if ($module->id() == $calendarModuleId) {
 return $module; };
                         }
                 }

                 return false;
         }
 }}}

-- 
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7259#comment:3>
vtiger development <http://trac.vtiger.com/>
vtiger CRM



More information about the vtigercrm-commits mailing list