[Vtigercrm-developers] Cant restore records from custom modules

lajeesh k lajeeshk at gmail.com
Tue Oct 8 14:10:10 GMT 2019


Hi

In restore function change $this->db->pquery to $adb->pquery
I had the same issue and fixed this way


Regards,
Lajeesh
Freelance developer / entrepreneur



On Fri, Oct 4, 2019 at 7:29 AM Rubén A. Estrada Orozco <rulotec1 at gmail.com>
wrote:

> Sending this message a second time, because it seems the first time failed:
>
> Hi everyone
>
> Has anybody noticed that restoring records from custom modules fails? It
> fails with modules I created as well as with modules from other 3rd
> parties. I spent some hours trying to fix it without success :(
>
> I get the following error:
>
> [image: image.png]
>
> If you try to restore it a second time, it takes a while before the http
> response is back:
> [image: image.png]
>
> The error is the following:
>
> Error restoring records : Query Failed:UPDATE vtiger_crmentity SET
> deleted=0,modifiedtime=?,modifiedby=? WHERE crmid = ?::ADODB error Error
> restoring records : Query Failed:UPDATE vtiger_crmentity SET
> deleted=0,modifiedtime=?,modifiedby=? WHERE crmid = ?::->Lock wait timeout
> exceeded; try restarting transaction
>
> Thats because the first time the the restore function at CRMEntity.php
>  executes, it doesn't complete (an exception is thrown when triggering the
> afterrestore event):
>
> [image: image.png]
>
> So the second time you try to restore the record, the vtiger_crmentity
> table is locked because of the startTransaction() call at line 1388 (I
> think) and that's why it takes a while.
>
> It is the following handler that throws the exception the first time you
> try to restore the record:   modules/Vtiger/handlers/EmailLookupHandler.php
> because it tries to instantiate the record that's being restored at line 84:
>
> [image: image.png]
>
> The strange thing is that it doesn't fail in the case of Vtiger native
> modules but only with custom modules, which is pretty strange.
>
> Disabling the above event results in successfully being able to restore
> records.
>
> Any help will be greatly appreciated.
>
> Saludos
>
> Rubén
>
> Saludos
>
> Rubén
> _______________________________________________
> http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20191008/064daff5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 25315 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20191008/064daff5/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 60670 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20191008/064daff5/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 144050 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20191008/064daff5/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 99490 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20191008/064daff5/attachment-0007.png>


More information about the vtigercrm-developers mailing list