Jump to content


Photo

Repeater field bug?


  • Please log in to reply
21 replies to this topic

#1 Marty Walker

Marty Walker

    Sr. Member

  • Members
  • PipPipPipPip
  • 335 posts
  • 155

  • LocationKatoomba, AU

Posted 27 May 2012 - 09:35 PM

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

#2 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 28 May 2012 - 03:11 AM

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.

#3 Marty Walker

Marty Walker

    Sr. Member

  • Members
  • PipPipPipPip
  • 335 posts
  • 155

  • LocationKatoomba, AU

Posted 28 May 2012 - 03:22 AM

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='http://www.youtube.com/embed/{$videoitem->video_link}?rel=0' frameborder='0' allowfullscreen></iframe></dd>";
}

Regards
Marty

#4 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 28 May 2012 - 03:57 AM

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?

#5 Marty Walker

Marty Walker

    Sr. Member

  • Members
  • PipPipPipPip
  • 335 posts
  • 155

  • LocationKatoomba, AU

Posted 28 May 2012 - 04:17 AM

Yes it's a brand new install from two days ago. I might update it and see what happens.

#6 Marty Walker

Marty Walker

    Sr. Member

  • Members
  • PipPipPipPip
  • 335 posts
  • 155

  • LocationKatoomba, AU

Posted 28 May 2012 - 05:27 AM

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.

Posted Image

#7 Marty Walker

Marty Walker

    Sr. Member

  • Members
  • PipPipPipPip
  • 335 posts
  • 155

  • LocationKatoomba, AU

Posted 28 May 2012 - 05:35 AM

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

#8 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 28 May 2012 - 05:35 AM

can you create a new template with this repeater field to see it it works there?

#9 Marty Walker

Marty Walker

    Sr. Member

  • Members
  • PipPipPipPip
  • 335 posts
  • 155

  • LocationKatoomba, AU

Posted 28 May 2012 - 05:51 AM

I think I have it sorted and I still think it's a bug but I'll experiment some more later. Thanks for your help diogo!

#10 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 28 May 2012 - 05:54 AM

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.

#11 ryan

ryan

    Hero Member

  • Administrators
  • 5,780 posts
  • 3124

  • LocationAtlanta, GA

Posted 29 May 2012 - 10:44 AM

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.

#12 tinacious

tinacious

    Full Member

  • Members
  • PipPipPip
  • 66 posts
  • 33

  • LocationToronto, Canada

Posted 30 May 2012 - 06:03 PM

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.

#13 tinacious

tinacious

    Full Member

  • Members
  • PipPipPip
  • 66 posts
  • 33

  • LocationToronto, Canada

Posted 30 May 2012 - 06:10 PM

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.

#14 tinacious

tinacious

    Full Member

  • Members
  • PipPipPip
  • 66 posts
  • 33

  • LocationToronto, Canada

Posted 30 May 2012 - 06:15 PM

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.

#15 tinacious

tinacious

    Full Member

  • Members
  • PipPipPip
  • 66 posts
  • 33

  • LocationToronto, Canada

Posted 30 May 2012 - 06:19 PM

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.

#16 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 31 May 2012 - 02:53 AM

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.

#17 ryan

ryan

    Hero Member

  • Administrators
  • 5,780 posts
  • 3124

  • LocationAtlanta, GA

Posted 31 May 2012 - 09:53 AM

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

#18 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 31 May 2012 - 10:20 AM

It seems to work now. The "Hero" word above your photo suits you well :)

#19 ryan

ryan

    Hero Member

  • Administrators
  • 5,780 posts
  • 3124

  • LocationAtlanta, GA

Posted 31 May 2012 - 12:30 PM

Great! Thanks for testing Diogo. :)

#20 AnotherAndrew

AnotherAndrew

    Sr. Member

  • Members
  • PipPipPipPip
  • 162 posts
  • 24

Posted 08 June 2012 - 08:07 PM

I am experiencing this bug too. I downloaded the latest commit, but I am still seeing unpublished on certain items. Do I need to re-enter the information (grrr) or is there a way to have it pushed to published?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users