Thank you for nailing down the scenario, I have tracked the issue. <div>Kindly review: <a href="http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7609">http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7609</a><div><br></div><div>
Regards,</div><div>Prasad<br><div>
<br><br><div class="gmail_quote">On Fri, Nov 30, 2012 at 3:53 PM, Alan Lord <span dir="ltr"><<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 29/11/12 17:22, Prasad wrote:<br>
</div><div>> Alan,<br>
><br>
> Can you please share a test case / hint of reproducing the bug.<br>
> If you have a setup where we can review that would useful too.<br>
<br>
</div>Hi Prasad,<br>
<br>
I've been doing some more testing this morning.<br>
<br>
This is how I'm registering the Event Handler:<br>
<br>
require('include/events/include.inc');<br>
require_once('include/utils/utils.php');<br>
global $adb;<br>
$em = new VTEventsManager($adb);<br>
$em->unregisterHandler('CompaniesHandler');<br>
$em->registerHandler('vtiger.entity.aftersave',<br>
'modules/Companies/CompaniesHandler.php',<br>
'CompaniesHandler',<br>
<div> "moduleName in ['Companies', 'Quotes', 'SalesOrder', 'Invoice']"<br>
</div>);<br>
<br>
And it all seems fine in the vtiger_eventhandlers table. In the "cond"<br>
field is the following text:<br>
<div><br>
moduleName in ['Companies', 'Quotes', 'SalesOrder', 'Invoice']<br>
<br>
</div>I've tried replacing ' with ", removing ' and removing the [] but all<br>
cause severe failures.<br>
<br>
However with the cond string as above, saving an *Account* record fails<br>
with the error described in my original post. And I don't think the<br>
CompaniesHandler Class isn't even called. The log stops before it gets<br>
there.<br>
<br>
Here are the final few lines of the log file when this happens:<br>
Fri Nov 30 10:06:40 2012,537 [7721] DEBUG index - Exiting is_admin<br>
method ...<br>
Fri Nov 30 10:06:40 2012,537 [7721] DEBUG index - Prepared sql query<br>
being executed : select * from vtiger_ws_entity where name=?<br>
Fri Nov 30 10:06:40 2012,537 [7721] DEBUG index - Prepared sql query<br>
parameters : [Users]<br>
Fri Nov 30 10:06:40 2012,538 [7721] DEBUG user - Entering Users() method ...<br>
Fri Nov 30 10:06:40 2012,538 [7721] DEBUG index - Entering<br>
getColumnFields(Users) method ...<br>
Fri Nov 30 10:06:40 2012,538 [7721] DEBUG index - in getColumnFields Users<br>
Fri Nov 30 10:06:40 2012,538 [7721] DEBUG index - Entering<br>
getTabid(Users) method ...<br>
Fri Nov 30 10:06:40 2012,538 [7721] DEBUG index - Exiting getTabid<br>
method ...<br>
Fri Nov 30 10:06:40 2012,539 [7721] DEBUG index - Exiting<br>
getColumnFields method ...<br>
Fri Nov 30 10:06:40 2012,539 [7721] DEBUG user - Exiting Users() method ...<br>
Fri Nov 30 10:06:40 2012,539 [7721] DEBUG index - Entering<br>
getTabid(Users) method ...<br>
Fri Nov 30 10:06:40 2012,539 [7721] DEBUG index - Exiting getTabid<br>
method ...<br>
Fri Nov 30 10:06:40 2012,539 [7721] DEBUG index - Prepared sql query<br>
being executed : select * from vtiger_users where id=? and deleted=0 and<br>
status='Active'<br>
Fri Nov 30 10:06:40 2012,539 [7721] DEBUG index - Prepared sql query<br>
parameters : [1]<br>
Fri Nov 30 10:06:40 2012,540 [7721] DEBUG index - Prepared sql query<br>
being executed : select groupname from vtiger_groups where groupid = ?<br>
Fri Nov 30 10:06:40 2012,540 [7721] DEBUG index - Prepared sql query<br>
parameters : [1]<br>
Fri Nov 30 10:06:40 2012,540 [7721] DEBUG index - Prepared sql query<br>
being executed : select first_name from vtiger_users where id = ?<br>
Fri Nov 30 10:06:40 2012,540 [7721] DEBUG index - Prepared sql query<br>
parameters : [1]<br>
Fri Nov 30 10:06:40 2012,541 [7721] DEBUG index - Prepared sql query<br>
being executed : select name from vtiger_ws_entity where id=?<br>
Fri Nov 30 10:06:40 2012,541 [7721] DEBUG index - Prepared sql query<br>
parameters : [11]<br>
Fri Nov 30 10:06:40 2012,542 [7721] INFO VT - PearDatabase ->ADODB<br>
getColumnNames table=com_vtiger_workflows<br>
Fri Nov 30 10:06:40 2012,543 [7721] DEBUG index - Prepared sql query<br>
being executed : select workflow_id, module_name, summary, test,<br>
execution_condition, defaultworkflow, type<br>
<br>
from com_vtiger_workflows where module_name=?<br>
Fri Nov 30 10:06:40 2012,543 [7721] DEBUG index - Prepared sql query<br>
parameters : [Accounts]<br>
Fri Nov 30 10:06:40 2012,544 [7721] DEBUG index - Prepared sql query<br>
being executed : SELECT * FROM com_vtiger_workflow_activatedonce<br>
WHERE<br>
entity_id=? and workflow_id=?<br>
Fri Nov 30 10:06:40 2012,544 [7721] DEBUG index - Prepared sql query<br>
parameters : [14,2]<br>
Fri Nov 30 10:06:40 2012,545 [7721] DEBUG index - Prepared sql query<br>
being executed : SELECT * FROM com_vtiger_workflowtasks<br>
INNER JOIN<br>
com_vtiger_workflowtask_queue<br>
ON<br>
com_vtiger_workflowtasks.task_id= com_vtiger_workflowtask_queue.task_id<br>
WHERE<br>
workflow_id=? AND entity_id=?<br>
Fri Nov 30 10:06:40 2012,545 [7721] DEBUG index - Prepared sql query<br>
parameters : [2,14]<br>
<br>
(That final query returns an empty result set)<br>
<br>
And that is it. It stops there with the:<br>
<div><br>
Fatal error: Uncaught exception 'Exception' with message 'Deadlock<br>
occured for events: CompaniesHandler' in<br>
</div>/var/www/vtigercrm/include/events/VTEventTrigger.inc:155 Stack trace: #0<br>
/var/www/vtigercrm/include/events/VTEventsManager.inc(118):<br>
VTEventTrigger->trigger(Object(VTEntityData)) #1<br>
/var/www/vtigercrm/data/CRMEntity.php(812):<br>
<div>VTEventsManager->triggerEvent('vtiger.entity.a...',<br>
Object(VTEntityData)) #2<br>
</div>/var/www/vtigercrm/modules/Accounts/Save.php(103):<br>
CRMEntity->save('Accounts') #3 /var/www/vtigercrm/index.php(749):<br>
include('/var/www/vtigercrm/mo...') #4 {main} thrown in<br>
/var/www/vtigercrm/include/events/VTEventTrigger.inc on line 155<br>
<br>
Removing the string entirely from the "cond" field and everything works<br>
again.<br>
<br>
hope that helps.<br>
<div><div><br>
Al<br>
<br>
--<br>
Libertus Solutions<br>
<a href="http://www.libertus.co.uk" target="_blank">http://www.libertus.co.uk</a><br>
<br>
<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</div></div></blockquote></div><br></div></div>
</div>