[Vtigercrm-developers] [BugReport]CRMEntity.php
nuthell
nuthell at gmail.com
Thu Aug 25 03:50:30 PDT 2011
*File*: vtiger_crm/data/CRMEntity.php
100 if($on_focus->IsCustomModule && method_exists($on_focus,
'save_related_module')) {
101 $with_module = $module;
102 $with_crmid = $this->id;
103 $on_focus->save_related_module(
104 $for_module, $for_crmid, $with_module, $with_crmid
);
105 }
sometimes , $for_crmid would be Empty or Equate with $with_crmid (depends on
the $_REQUEST['return_id']).
*Description:*
I made a CustomModule and created a record. when I duplicate the record and
save , it Occurs an Error.
(mysql): SELECT crmid FROM vtiger_crmentityrel WHERE crmid = '' AND module =
'MBOrders' AND relcrmid = 175 AND relmodule = 'MBOrders'
(mysql): INSERT INTO vtiger_crmentityrel(crmid, module, relcrmid, relmodule)
VALUES('','MBOrders',175,'MBOrders')
*Solution:*
100 if( !empty($for_module) && !empty($for_crmid) &&
$on_focus->IsCustomModule
&& method_exists($on_focus, 'save_related_module')) {
101 $with_module = $module;
102 $with_crmid = $this->id;
if($for_crmid != $with_crmid && $for_module !=
$with_module)
103 $on_focus->save_related_module(
104 $for_module, $for_crmid, $with_module, $with_crmid
);
105 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20110825/8bd9dba7/attachment-0002.html
More information about the vtigercrm-developers
mailing list