Closed allyh12 closed 4 years ago
logs ?
Hi Mariusz,
Thanks for your prompt response.
I'm very sorry for asking some help as I'm new to Yetiforce. Appreciate if you could provide some guidance on getting the logs ready for you.
https://yetiforce.com/en/knowledge-base/documentation/implementer-documentation/item/debugging
I refered to the above link and changed log-errors and display_errors to On in user.ini. Then, I tried to create the record to generate the error again but I still couldn't see those log files.
Thanks.
Regards, Ally
Sent from Outlookhttp://aka.ms/weboutlook
From: Mariusz Krzaczkowski notifications@github.com Sent: Friday, 27 March 2020 2:36 PM To: YetiForceCompany/YetiForceCRM YetiForceCRM@noreply.github.com Cc: allyh12 bengkhim@live.com; Author author@noreply.github.com Subject: Re: [YetiForceCompany/YetiForceCRM] [bug] Workflows Error when task was executed during record creation (#12782)
logs ?
β You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/YetiForceCompany/YetiForceCRM/issues/12782#issuecomment-604839517, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOHVI6AYR2JO253J3Y45ZJ3RJRCOFANCNFSM4LUX7YQA.
Hi Mariusz,
I managed to get the system log! Please check if this is sufficient.
Thanks, Ally
Sent from Outlookhttp://aka.ms/weboutlook
From: Allison Ho bengkhim@live.com Sent: Friday, 27 March 2020 3:19 PM To: YetiForceCompany/YetiForceCRM reply@reply.github.com Subject: Re: [YetiForceCompany/YetiForceCRM] [bug] Workflows Error when task was executed during record creation (#12782)
Hi Mariusz,
Thanks for your prompt response.
I'm very sorry for asking some help as I'm new to Yetiforce. Appreciate if you could provide some guidance on getting the logs ready for you.
https://yetiforce.com/en/knowledge-base/documentation/implementer-documentation/item/debugging
I refered to the above link and changed log-errors and display_errors to On in user.ini. Then, I tried to create the record to generate the error again but I still couldn't see those log files.
Thanks.
Regards, Ally
Sent from Outlookhttp://aka.ms/weboutlook
From: Mariusz Krzaczkowski notifications@github.com Sent: Friday, 27 March 2020 2:36 PM To: YetiForceCompany/YetiForceCRM YetiForceCRM@noreply.github.com Cc: allyh12 bengkhim@live.com; Author author@noreply.github.com Subject: Re: [YetiForceCompany/YetiForceCRM] [bug] Workflows Error when task was executed during record creation (#12782)
logs ?
β You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/YetiForceCompany/YetiForceCRM/issues/12782#issuecomment-604839517, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOHVI6AYR2JO253J3Y45ZJ3RJRCOFANCNFSM4LUX7YQA.
@MacarenaReina @allyh12 @mariuszkrzaczkowski its same issue as https://github.com/YetiForceCompany/YetiForceCRM/issues/12768
the issue is with only VTUpdateFieldsTask with recordModel->save()
particularly with
public function getEventHandler(): App\EventHandler
{
if (!$this->handler) {
$this->handler = (new \App\EventHandler())->setRecordModel($this)->setModuleName($this->getModuleName());
}
return $this->handler;
}
if you replace
$eventHandler = $this->getEventHandler();
with
$eventHandler = new App\EventHandler();
$eventHandler->setRecordModel($this);
$eventHandler->setModuleName($moduleName);
everything the record saves just fine but it may break the additional validation implemented in https://github.com/YetiForceCompany/YetiForceCRM/commit/028601e97fd9c537e49890af4c97ec99f0448ac9#diff-b7da741f3a161a40feb12e45abc510eb
This happens in gitstable too, just tested. It appears that YetiForce tries to save the same record two times getting a duplicate key error from the database engine. If I disable the workflow that bind to "On create" all works fine. Also the Every time a record is created bind causes the same error.
I noticed that this happens if the workflow tries to modify the just created record. If I use the same worflow but I change the field to modify from the same module to a related module all works fine
P.S.: For anyone looking for a solution and want to test a patch, I posted one to the issue #12768
π bug report
βοΈ Describe the bug A workflow scheduled with 'Creating a Record' and 'Update Fields' was created. Error message pops up when record was created. However, workflow get executed and fields have been updated.
π₯ How to trigger the error
Steps to reproduce the behavior: everytime when new record is created
π Actual Behavior Error Message
π Expected Behavior No error message
π· Testing
π· Screenshot of configuration
π PHP/Apache/Nginx/Browser/CRM Logs
π Your Environment
β Additional context
βοΈ Inform the community if you solve the problem