espocrm icon indicating copy to clipboard operation
espocrm copied to clipboard

Duplicating a Task created from an Email not possible

Open SuchAFuriousDeath opened this issue 1 month ago • 7 comments

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:

  1. Create a task from an email
  2. In the detail of this Task, click the 'Duplicate' button'
  3. Attempt to save the duplicated task.
  4. Observe error

Expected behavior The task duplication should work.

Screenshots

Image

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

SuchAFuriousDeath avatar Nov 06 '25 22:11 SuchAFuriousDeath

Maybe setting duplicateIgnore for the field could fix it. https://docs.espocrm.com/development/metadata/entity-defs/#duplicateignore

yurikuzn avatar Nov 07 '25 06:11 yurikuzn

AFAIK, the field does not exist, only a link.

SuchAFuriousDeath avatar Nov 07 '25 08:11 SuchAFuriousDeath

I fixed it for myself by adding the field.

SuchAFuriousDeath avatar Nov 07 '25 09:11 SuchAFuriousDeath

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,

yurikuzn avatar Nov 07 '25 17:11 yurikuzn

I didn't say required. I'm done arguing about this anyway. Everyone should contribute and that's the point.

bandtank avatar Nov 07 '25 17:11 bandtank

Couldn't agree more. But there was nothing for me to contribute beyond my initial report and comments.

SuchAFuriousDeath avatar Nov 07 '25 17:11 SuchAFuriousDeath

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.

yurikuzn avatar Nov 07 '25 17:11 yurikuzn