[7.460][FEATURE][NOTABUG] clone user clone email but error when applying

Hi

Seems when you clone a user it does clone the main email address also but letting that email for another username will results into an error message:


Cannot apply changes:
resource is already in use


As this is not permited you must not duplicate the main email address !!!

thx
Parents

  • Seems when you clone a user it does clone the main email address also


    Yes, it works as designed.
    That's the meaning of "clone":
    Make an exact copy of everything.


    but letting that email for another username will results into an error message:


    Yes, of course.
    There is no guarantee that you can have two exactly identical objects.
    In fact, for most object types, you can't.
    It is completely normal that you must edit a cloned object before you can save a copy.

    What's the point of cloning if you don't intend to change anything?
    In that case, just use the original copy...
Reply

  • Seems when you clone a user it does clone the main email address also


    Yes, it works as designed.
    That's the meaning of "clone":
    Make an exact copy of everything.


    but letting that email for another username will results into an error message:


    Yes, of course.
    There is no guarantee that you can have two exactly identical objects.
    In fact, for most object types, you can't.
    It is completely normal that you must edit a cloned object before you can save a copy.

    What's the point of cloning if you don't intend to change anything?
    In that case, just use the original copy...
Children
  • Bingo, Ingo! [;)] (I'm probably not the first person to make that joke...)

    That's why cloning makes no sense for User Definitions.

    Cheers - Bob

  • Bingo, Ingo! [;)] (I'm probably not the first person to make that joke...)


    Oh, i *think* i remember hearing it, but i'm not sure anybody made it during the last quarter of a century or so...  [:D]


    That's why cloning makes no sense for User Definitions.


    Right, you probably want to change the user name, the real name, the email addresses and the passwords, so there are not many fields you migth wish to leave untouched.

    I'm not a big fan of the "Clone" feature anyway.  Currently, it's implemented purely in the JavaScript frontend, not even the WebAdmin backend is involved.  At some point, it might make sense to move it into the Confd, having object-specific functions Object::clone, just like we do already have object-specific functions Object::validate.  That would allow fancy features like clearing the email addresses when cloning, and making sure that "Clone" does the right thing even in weird edge cases would definitely become easier.  But doing that would involve quite a bit of work, and i'm not sure how many customers will actually be using the "Clone" buttons.
  • Ok so this is not a bug... this is an unwanted side effect behaviour [:)]