Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Can't clone a node more than once #193

Open
gschueler opened this issue Aug 21, 2012 · 1 comment
Open

Can't clone a node more than once #193

gschueler opened this issue Aug 21, 2012 · 1 comment
Labels

Comments

@gschueler
Copy link
Member

If you clone a node, then go back to the original and try to clone it again, it fails.

likely because the clone is always named after the original with "_clone" added to it, but since node names must be unique it fails to create another one with that name.

The clone action should automatically check for _clone and if it exists, add a number, e.g. _clone2 or _clone3, etc.

@orubel
Copy link
Contributor

orubel commented Aug 24, 2012

I had to do something similar for users with linkedin oauth creation where they didn't want a login except through Linkedin...

private boolean nodeNameLookup(String name){
Node nd = Node.findByName(name)
if(nd==null){
return false
}else{
return true
}
}

if(nodeNameLookup(name)){
int inc=1
nodename="${name}${inc}"
while(nodeNameLookup(nodename)){
inc++
nodename="${name}${inc}"
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants