-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
When duplicating an attachment, the attachment of the clone is used as a reference (line 92).
Lines 89 to 95 in d9c92a1
| protected function duplicateAttachments($clone) { | |
| if (!$this->attachment || !method_exists($clone, 'getCloneableFileAttributes')) return; | |
| foreach($clone->getCloneableFileAttributes() as $attribute) { | |
| if (!$original = $clone->getAttribute($attribute)) continue; | |
| $clone->setAttribute($attribute, $this->attachment->duplicate($original)); | |
| } | |
| } |
This probably doesn't matter in most cases, but it does with the attachment handler I use. This handler will for example generate the path based on properties of the model, like its key/ID. So in my adapter I cannot get the path of the current existing attachment, because the key is different in the clone.
Duplicating from the original model instead of the clone fixes my issue. It also seems more logical to me to duplicate from an original instead from a clone (which should only receive the duplicate).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels