[Vtigercrm-developers] [BugReport]CRMEntity.php

Asha asha at vtiger.com
Thu Aug 25 10:19:54 PDT 2011


Thanks for identifying the issue.

Please report the issue on trac system along with the preferred patch. We
shall analyze it sooner and update that status on the ticket.

On Thu, Aug 25, 2011 at 4:20 PM, nuthell <nuthell at gmail.com> wrote:

> *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             }
>
> _______________________________________________
> http://www.vtiger.com/
>



-- 
Regards,
Asha
vtiger Team

*Connect with us on: *Twitter <http://twitter.com/#%21/vtigercrm> *I*
Facebook <http://www.facebook.com/pages/vtiger/226866697333578?sk=wall> *I*
Blog <http://blog.vtiger.com/>* I*
Wiki<http://wiki.vtiger.com/index.php/Main_Page>
 *I *Forums  <http://forums.vtiger.com/>*I* Website <http://vtiger.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20110825/035abaa5/attachment-0002.html 


More information about the vtigercrm-developers mailing list