Jump to content

Problem with repeater


Frank Vèssia
 Share

Recommended Posts

I'm setting up 3 repeaters for the user template (i guess i can use repeaters with the user template).

Well, when i'm trying to save some date via API with this code:


if ($input->post->submit_equipment && $input->urlSegment1=="equipment"){

   $camera = array();
   $camera = $input->post->camera;
   $user->setOutputFormatting(false);
   foreach($camera as $c){
       $cameraRow = $user->camera->getNew();
       $cameraRow->title = $c;
   }
   if($user->save()){
       $session->redirect("/profile-edit/equipment/success/",false);
   }

}

i got all my 3 repeaters filled with this data.

The other problem is when i try to create some data from the admin...look at the picture...Missing field...what ?

post-25-0-50512200-1345415799_thumb.png

Link to comment
Share on other sites

OK i think i got the bug...

I created the other 2 repeaters using the duplicate/clone function.

Now i can see on "detail" tab the same value for all repeaters:

This repeater uses template 'repeater_camera' and parent '/gladmin/repeaters/for-field-152/'

Something wrong in the clone process ?

Link to comment
Share on other sites

Repeater fields can't be cloned yet. I couldn't find a way to make it workable in the short term, so I set it to throw an Exception if you try to clone an repeater field (preventing the clone from happening). It could be that you have one of the versions between when repeaters were added and when the repeater cloning issue was discovered, so you may want to upgrade to the latest. Though let me know if this is occurring even on the latest version. But I think that's very likely the issue, and that you need to create those fields without the clone. Please let me know what you find.

Link to comment
Share on other sites

Another thing.

In my form i display a list of input text according to the available repeaters, the inputs are filled with the corresponding value, if no repeater i display only one input. (I can add more input with a button)

Now i noticed a strange behaviour, first the form displayed 3 empty input field for each repeater, because there was the option "Ready to edit" set to 3 so for my code there was 3 repeaters...

When i removed this option there still some messy, especially in the admin tree, i can see the repeater field duplicated and also the 3 "ready to edit" fields not deleted. See the picture

@Ryan: okay read right now, I thought to have the latest version...I'll update immediately... :)

post-25-0-67589500-1345466530_thumb.png

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...