Jump to content

Repeater field bug?


Marty Walker
 Share

Recommended Posts

Hi,

I have a page template that has a repeater fieldtype (with two fields in it). For some reason (that I can't see) those repeater fields only display when I'm logged in as the admin and not as a guest. I don't have any access restrictions on the template and any other fields show up.

I'm using the latest 2.2.2.

Regards

Marty

Link to comment
Share on other sites

can you paste the code your using to call the fields? sounds like you are calling the hidden repeater field pages directly instead of the fields themtself.

Link to comment
Share on other sites

Sure. But they definitely display correctly when I view the page as an admin.

<?php
foreach($page->videos as $videoitem) {
 echo "<dt><a href=''>{$videoitem->title}</a></dt>";
 echo "<dd><iframe width='{$vidx}' height='{$vidy}' src='https://www.youtube.com/embed/{$videoitem->video_link}?rel=0' frameborder='0' allowfullscreen></iframe></dd>";
}

Regards

Marty

Link to comment
Share on other sites

Definitely not what I thought. You are outputting them correctly, but I can't reproduce your error with the same code in my testing environment. Are you using last version of PW?

Link to comment
Share on other sites

Well I updated the install and I still get the same issue. I can see all the content when logged in but not when logged out. Here's a screen of the permissions for the page template. There's nothing bizarre in my template code that restricts any views. I really do not know why it's doing it.

Image%202012.05.28%208:22:55%20PM.png

Link to comment
Share on other sites

I think I know what it might be. When I originally added my new template I asked PW to duplicate fields from another template.

Just then I created a new template and added the fields manually and it all works now.

Regards

Marty

Link to comment
Share on other sites

Ok, so lets wait for Ryan to see this :)

edit:

I think I know what it might be. When I originally added my new template I asked PW to duplicate fields from another template.

I only saw this answer now. Ya, must be a bug.

Link to comment
Share on other sites

So far I'm confused on this one. When you import fields, it's not getting involved in anything with access control. Repeater pages are also inaccessible to guest either way. They are only accessible via the page they originate from. What you describe sounds like a bug in there somewhere, but so far I can't consciously connect the result with the identified cause. I'll experiment. If anyone else experiences a similar result please let me know.

Link to comment
Share on other sites

I'm also having a similar issue.

When I create and preview the page, it shows up great. When I publish it, it doesn't show up. I'm also using repeater fields. There must be a bug with it or something.

Here is my code:

<?php $counter = 1;
foreach($page->step as $item) {
$step_title = $item->single_line_text;
$step_desc = $item->message;
echo '<div class="hire-number"><p>' . $counter . '</p></div><div class="hire-main">';
echo '<h2>' . $step_title . '</h2> <p>' . $step_desc . '</p></div>';
$counter++;
} ?>

I will try creating a new template using the fields and see how it goes.

Link to comment
Share on other sites

Ok so I re-created the page using the template. It seems as though this bug—where the repeater fields do not appear upon publish (but show perfectly in preview)—happens if you modify the template while you're creating the page. Once the template has been created, you can create a page and it'll be good to go.

Recreating the page is a work-around to this until it is fixed.

Link to comment
Share on other sites

There is a bug with the repeater fields. You can't create more than a certain amount, and if you do you need to publish the page because if you save without publishing, those fields will be marked unpublished and there's no way to publish just one of the repeater fields in that group. Weird.

Link to comment
Share on other sites

To fix this after the fact I just deleted those unpublished fields and re-added them.

So basically: do not "Save without Publishing" on repeater fields otherwise you won't be able to publish those fields.

Link to comment
Share on other sites

here is a bug with the repeater fields. You can't create more than a certain amount, and if you do you need to publish the page because if you save without publishing, those fields will be marked unpublished and there's no way to publish just one of the repeater fields in that group. Weird.

I can confirm this. Just reproduced it. All the repeater fields that were created while the page was "saved + kept unpublished" stopped being outputted to the page after i finally published it, although they still appear in the admin side.

Link to comment
Share on other sites

Thanks for testing this guys. I was able to reproduce it, though only on non-ready repeater pages (i.e. those that say "this will become editable after you save"). I've committed a fix to the source. I was wondering if you could grab it and let me know if it also resolves the issue on your end?

Thanks,

Ryan

Link to comment
Share on other sites

  • 2 weeks later...

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