Duplicating a Task created from an Email not possible
Describe the bug Duplicating a Task created from an email results in a "Cannot set ID attribute for link 'email' as there's no link field." error.
To Reproduce (MANDATORY, DO NOT REMOVE) Explicit steps to reproduce the behavior:
- Create a task from an email
- In the detail of this Task, click the 'Duplicate' button'
- Attempt to save the duplicated task.
- Observe error
Expected behavior The task duplication should work.
Screenshots
EspoCRM version 9.0.4, 9.2.4 (latest)
Additional context The issue is that the emailId of the Task is not unset and is returned by a getDuplicateAttributes call. https://github.com/espocrm/espocrm/blob/748392ab7f56c36695bb2f1cec410f0aab5fad4b/application/Espo/Core/Record/Duplicator/EntityDuplicator.php#L56
Maybe setting duplicateIgnore for the field could fix it. https://docs.espocrm.com/development/metadata/entity-defs/#duplicateignore
AFAIK, the field does not exist, only a link.
I fixed it for myself by adding the field.
That was unecessary.
The information provided by @SuchAFuriousDeath is valuable and will save me time.
Nobody is obliged to provide fixes. A properly reported bug is already a valuable contribution. Fixes are likelty to be not accepted because they may break something. It's usually easier to fix for me, but any help with research is helpful and saves me time,
I didn't say required. I'm done arguing about this anyway. Everyone should contribute and that's the point.
Couldn't agree more. But there was nothing for me to contribute beyond my initial report and comments.
This issue might not have an easy fix. Adding the link field might indroduce s security (access control) problem. I'll need to investigate it more when get a chance.