core icon indicating copy to clipboard operation
core copied to clipboard

Copy host: a renamed file has its old name after a copy host

Open ghost opened this issue 12 years ago • 3 comments

I ran into a strange issue that possibly also explains issue #4894. After a copy host I noticed that some files could not be found. When comparing the 2 hosts using WEBDAV and Beyond Compare there were no differences, but in the Site Browser I noticed that the files had different names. When opening a file, the filename was the one it should be but the Site Browser showed the wrong (old) one. Save/publishing the file solved the issue.

When checking the file again the History tab showed both the old filename and the new filename multiple times. I think something goes wrong with this. Unfortunately I can't reproduce this at the moment since someone changed the admin password on the demo website. I'll try to do this as soon as possible.

ghost avatar Feb 27 '14 14:02 ghost

I was able to reproduce this on the demo website (shared), after 2 tries: First try (didn't reproduce):

  1. Rename the file /vtl/widgets/full-site/account-confirmation.vtl to /vtl/widgets/full-site/account-confirmation-renamed.vtl
  2. Copy host shared
  3. Check the file in the site browser, it is named account-confirmation-renamed.vtl

Second try (this reproduced the issue):

  1. Upload a new version of the /vtl/widgets/full-site/account-confirmation.vtl with a small change (3 times)
  2. Rename the /vtl/widgets/full-site/account-confirmation.vtl to /vtl/widgets/full-site/account-confirmation-renamed.vtl
  3. Upload a new version of the file /vtl/widgets/full-site/account-confirmation-renamed.vtl with a small change
  4. Copy host shared
  5. Check the file. In the site browser it is named account-confirmation.vtl but in WEBDAV or when editing it is named account-confirmation-renamed.vtl. After a save/publish it is ok again.

I have some screenshots: 2014-02-27 15_50_21-site browser _ dotcms 2014-02-27 15_52_14-dotcms _ enterprise web content management 2014-02-27 15_52_27-site browser _ dotcms

Xander-Steinmann avatar Feb 27 '14 14:02 Xander-Steinmann

it turns out contentletAPI.copyContentlet moves all the versions of the content/fileasset. so it should save older versions first and make sure the working version is the last to be saved. There was the bug

dotjorgeu avatar Mar 31 '14 21:03 dotjorgeu

Fixed, Tested on Nightly Build 2014-04-01

bryanboza avatar Apr 02 '14 17:04 bryanboza