Cloning a node changes image paths on the original node

Created on 21 August 2025, 20 days ago

Problem/Motivation

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.

Steps to reproduce

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.)

Proposed resolution

Remaining tasks

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.

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

1.14

Component

Code

Created by

🇯🇵Japan dc-kinoshita

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024