Support

Account

Home Forums Bug Reports get_row doesn't reset in a have_rows loop Reply To: get_row doesn't reset in a have_rows loop

  • Hey sorry for the very late reply. I am still coming across this issue but it happens for me when I have a flexible field inside a repeater.

    if (have_rows('tab_content')){
      while(have_rows('tab_content')){
    
        $tabContent[$i]['tab_name'] = get_sub_field('tab_name');
        $tabContent[$i]['tab_description'] = get_sub_field('tab_description');
    
        if(have_rows('content')){
          while(have_rows('content')){
            the_row();
    	$currentLayout = get_row_layout();
    	$tabData['row'] = get_row(true); // Information in this is cached
    	$tabData['content_columns'] = get_sub_field('content_columns'); // Works if I directly call it like this
    	$tabContent[$i]['tab_content_layouts'][] = Render('page-flex__'.$currentLayout.'.twig', $tabData);
          }//end while
        }//end if
          $i++;
      }//end while
    }//end if
    //Render main with $tabContent
    $data['tab_content'] = $tabContent;
    Render('page-section-layout.twig', $data)
    

    I am using ACF Pro version 5.6.10