Jump to content

Possible to move repeater items from one field to another while maintaining the ID?


bernhard
 Share

Recommended Posts

Hi everyone!

Today I had to move some data stored in a repeater field to another field. I searched the forum and found an admin action by @adrian and came up with a new method in rockmigrations that can copy or move repeater items to new fields and/or new pages: https://github.com/baumrock/RockMigrations/blob/ad59425831c74e32034035afa9d2276f398cc2be/RockMigrations.module.php#L3536

Now I realised that there is a problem: The way this works is it creates new items and then removes the old items. But that also means that IDs change 😮 And I have referenced those repeater items from somewhere else.

Does anybody have an idea of how to do that?

Link to comment
Share on other sites

I solved this by renaming the field instead of moving content. In this case this was the even better (as more performant) solution, but I'd still be interested if anyone knows another way of doing this!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...