Home › Forums › Bug Reports › ACF PRO Upgrade to 5.7.7 Group Issues
Hi folks,
Just upgraded an earlier version of ACF PRO to 5.7.7 and encountered an issue with my group fields.
We have four groups, each with a text field, taxonomy field and image field. The code below worked fine up until the upgrade:
<div class="block-buttons">
<div class="container">
<section id="home-shop-wrapper">
<div class="home-shop-row">
<?php if( have_rows('top_left') ):
while( have_rows('top_left') ): the_row(); ?>
<?php
// first, get the image object returned by ACF
$image_object = get_sub_field('top_left_bg');
// and the image size you want to return
$image_size = 'large';
// now, we'll exctract the image URL from $image_object
$image_url = $image_object['sizes'][$image_size];
?>
<?php $top_left_link = get_sub_field('top_left_link'); ?>
<div class="home-shop top-left" style="background:url('<?php echo $image_url; ?>') no-repeat; background-size:cover; background-position:center center;">
<article class="col">
<div class="spacer"></div>
<a href="<?php echo get_term_link($top_left_link) ?>">
<div class="circle">
<div class="wrapcontent">
<span>Shop all</span>
<h2><?php the_sub_field('top_left_title'); ?></h2>
<span>products</span>
</div>
</div>
</a>
</article>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php if( have_rows('top_right') ):
while( have_rows('top_right') ): the_row(); ?>
<?php
// first, get the image object returned by ACF
$image_object = get_sub_field('top_right_bg');
// and the image size you want to return
$image_size = 'large';
// now, we'll exctract the image URL from $image_object
$image_url = $image_object['sizes'][$image_size];
?>
<?php $top_right_link = get_sub_field('top_right_link'); ?>
<div class="home-shop top-right" style="background:url('<?php echo $image_url; ?>') no-repeat; background-size:cover; background-position:center center;">
<article class="col">
<div class="spacer"></div>
<a href="<?php echo get_term_link($top_right_link) ?>">
<div class="circle">
<div class="wrapcontent">
<span>Shop all</span>
<h2><?php the_sub_field('top_right_title'); ?></h2>
<span>products</span>
</div>
</div>
</a>
</article>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div class="home-shop-row">
<?php if( have_rows('bottom_left') ):
while( have_rows('bottom_left') ): the_row(); ?>
<?php
// first, get the image object returned by ACF
$image_object = get_sub_field('bottom_left_bg');
// and the image size you want to return
$image_size = 'large';
// now, we'll exctract the image URL from $image_object
$image_url = $image_object['sizes'][$image_size];
?>
<?php $bottom_left_link = get_sub_field('bottom_left_link'); ?>
<div class="home-shop bottom-left" style="background:url('<?php echo $image_url; ?>') no-repeat; background-size:cover; background-position:center center;">
<article class="col">
<div class="spacer"></div>
<a href="<?php echo get_term_link($bottom_left_link) ?>">
<div class="circle">
<div class="wrapcontent">
<span>Shop all</span>
<h2><?php the_sub_field('bottom_left_title'); ?></h2>
<span>products</span>
</div>
</div>
</a>
</article>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php if( have_rows('bottom_right') ):
while( have_rows('bottom_right') ): the_row(); ?>
<?php
// first, get the image object returned by ACF
$image_object = get_sub_field('bottom_right_bg');
// and the image size you want to return
$image_size = 'large';
// now, we'll exctract the image URL from $image_object
$image_url = $image_object['sizes'][$image_size];
?>
<?php $bottom_right_link = get_sub_field('bottom_right_link'); ?>
<div class="home-shop bottom-right" style="background:url('<?php echo $image_url; ?>') no-repeat; background-size:cover; background-position:center center;">
<article class="col">
<div class="spacer"></div>
<a href="<?php echo get_term_link($bottom_right_link) ?>">
<div class="circle">
<div class="wrapcontent">
<span>Shop all</span>
<h2><?php the_sub_field('bottom_right_title'); ?></h2>
<span>products</span>
</div>
</div>
</a>
</article>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</section>
</div>
</div>
What happened after the upgrade was this: the first group displayed fine. The background of the second group displayed, and nothing else worked after this. It then wouldn’t load any code from this point. I have combed through my code a few times and can’t see any problems. Copied and pasted the first group’s code and that worked fine. Tried WP_Debug and no errors came up.
I rolled back to an older download I have of ACF PRO (5.6.1) and it’s working fine now.
I’m not sure if this is a bug but it’s only occurred since upgrading. If you need me to run other tests I’ll do my best. Likewise if it’s something that has changed that I need to recode for please let me know.
Thanks
The topic ‘ACF PRO Upgrade to 5.7.7 Group Issues’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.