"Clone Model" causes Template to use new model

  • 2
  • Problem
  • Updated 3 years ago
  • Acknowledged
I've discovered that if I clone a model, my templates that use the original model automatically changes to use the newly cloned model. Obviously this isn't exactly the behavior I'd expect from the template. 

Is this a known issue? Does it impact more than just templates?
Photo of Josh Merritt

Josh Merritt

  • 918 Points 500 badge 2x thumb

Posted 3 years ago

  • 2
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
How are you cloning the model within the context of an existing page? Unless I being stupid its not exactly standard functionality. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Rob... I'm experiencing the same thing.

In the builder:


When we use this clone model button, some components (I've had tables and field editors as well as templates) seem to update to use the cloned model instead of the original one. Doesn't seem to be consistent, though.
Photo of Josh Merritt

Josh Merritt

  • 918 Points 500 badge 2x thumb
Matt, I think I figured out the behavior. Essentially it seems to happen with "renaming" the model. If you deleted the added number, it registers it has the same name as another model, causing the components to switch to the most recently created one (Just my guess give the way other actions within Skuid are time/create date based).
Photo of Josh Merritt

Josh Merritt

  • 918 Points 500 badge 2x thumb
I'm using the "clone" button that is available when you select a model. In capturing screenshots of the process, I discovered that the issue happens when you rename the newly cloned model.

The system just adds a number to the end of the model name, so when I'm renaming it, I delete the number, which instantly seems to result in the components that use the original model getting tied to the newly created one. 

Does that make sense?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Well.  I am being stupid. 

Josh is exactly right.  If while you are renaming your cloned model,  you get the name to a state where it exactly matches the original model,  the component listening infrastructure gets confused and associates all components with the new cloned version.   What I always do is add my additional clarifying name onto the end of the model name abefore deleting the number.   

Not exactly obvious.   Room for improvement.