Cloning Clones


https://forum.kartris.com/Topic6873.aspx
Print Topic | Close Window

By Tiggywiggler - Thu 16 Mar 2017
Hello everyone,

If you have ever tried to clone a single version that is itself a clone of a single version (tried to clone a clone) you will find that the system throws an error. The result is that no versions are created for the new clone, even though the clone itself appears to go well.

The reason for this is that the string "[clone-xxx]" is appended to the end of the version name in each case. This means that if you clone version "SKU_100" you will then get "SKU_100[clone-101]", if you then clone this it tries (and fails) to generate version "SKU_100[clone-101][clone-102]" because the version string is too long.

My solution has been to strip the "[clone-xxx]" string for each new clone. for example:

Product 100:
"SKU_100"

Product 101:
"SKU_100[clone-101]"

Product 102:
"SKU_100[clone-102]"

This works, but of course gives the impression that product 102 is a clone of product 100, when it is actually a clone of 101. I am not too concerned by this because at least this way it actually works. Just be aware of this if deciding to implement this change.

The attached SQL file makes the change for anyone running the latest version of the application.
By Paul - Mon 20 Mar 2017
We'd kind of assumed that people will generally edit the SKUs when cloning anyway; the SKUs we formatted were clunky and were primarily to ensure the new values were (a) different from the originals and (b) clearly cloned from another item, and hence ugly looking enough to stand out as needing fixing.

But I think the change you suggest makes things more elegant; will look at integrating this to the next release.
By Tiggywiggler - Sat 25 Mar 2017
The reason for not always cloning the original is that if I am entering 5 very similar products, and my product list for this category is a couple of hundred items long, rather than finding the original and cloning that I just press 'Clone' after saving each new item.

Make 1, Clone,
fill in the details, clone
fill in the details, clone
fill in the details, clone
fill in the details, clone
etc.

I hope this makes sense.