- Issue created by @dc-kinoshita
- 🇮🇳India kulpratap2002
I can't reproduce the issue with different file names; both use the same file path in my case, and no copy is created.
When cloning a node that contains images, the image file path on the original node changes.
If the image save fails during the cloning process, the original node can end up referencing a non-existent path (image appears “lost”).
I’m using version 8.x-1.14 (of the cloning module) and couldn’t find a related fix in newer releases or an existing issue.
Drupal 9.5.11
1. Create a content type with an image field (reproducible with Paragraphs image fields as well).
2. Create a node and upload an image (path = image_path_a).
3. Clone the node.
4. Check image paths:
- The cloned node’s image path is image_path_b.
- The original node’s image path also changes to image_path_b.
Expected result
1. Cloning should not modify the original node.
2. The clone should either reference the same file or a copied/renamed file, but the original node’s image path must remain image_path_a.
Actual result
1. After cloning, both nodes point to image_path_b.
2. If saving the clone fails mid-process, the original node may reference a path that doesn’t exist, effectively “losing” the image.
Environment / related modules
- Drupal core: 9.5.11
- Cloning module: 8.x-1.14
- Storage: S3 via s3fs
Other modules in use (may affect file paths/storage):
- filefield_paths 8.x-1.0-beta7
- pathauto 8.x-1.12
- s3fs 8.x-3.4
(Happy to provide additional configuration if needed.)
1. Confirm the expected behavior when cloning nodes with image fields.
2. If the current behavior is incorrect, define the correct behavior and consider a fix.
Active
1.14
Code
I can't reproduce the issue with different file names; both use the same file path in my case, and no copy is created.