manlio Posted January 10, 2021 Share Posted January 10, 2021 Hello! I have this problem and I don't know how to fix it. In the user template, I have inserted a repeater field (called user_payment). This repeater is populated from API after a payment confirmation. My initial code was wrong and only in a second time I have fixed it adding the last two rows $mypay = $user->user_payment->getNew(); $mypay->text = $mytext; $mypay->of(false); $mypay->save(); //** Added later $user->user_payment->add($mypay); $user->save(); Some payments was stored in the wrong way and now I am able to see the data when I edit a user in the PW admin backend, but I can't search them in lister pro or in an API search. I can fix the problem if I edit the user and save the page from the backend, but I wanna know if there is a way to automatically fix all the data. Thank you for any suggestion! Ciao Link to comment Share on other sites More sharing options...
Robin S Posted January 12, 2021 Share Posted January 12, 2021 This might work: foreach($users as $u) { $u->of(false); $u->save('user_payment'); } 1 Link to comment Share on other sites More sharing options...
manlio Posted January 12, 2021 Author Share Posted January 12, 2021 In the meantime I have manually fixed all the compromised records using the admin and I cannot test it, but thank you very much Robin for taking time to provide this solution. Really helpful for any additional repeater problem ? Have a nice day. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now