• Resolved dominikkucharski

    (@dominikkucharski)


    Hi

    I’ve observed that when I have Repeater field in the Flexible Field and I’m showing it in the Dynamic Preview, the amount of returned rows is bigger than on the frontend by one.

    Could you check this problem?

    Best regards

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the report!

    I think the additional row you get in your data is the “clone” (the actual row model).

    This behavior is identic to the Gutenberg ACF Block preview. I’ll see what I can do about that. Meanwhile you can probably exclude it using the field key/name, should be something like acfcloneindex.

    I’ll dig in and let you know what I find!

    Regards.

    Thread Starter dominikkucharski

    (@dominikkucharski)

    Hi

    I observed that in the backend ACF is returning additional Array item in the repeater with acfcloneindex name. Do you know how can I ignore this row when I’m using standard ACF repeater walker? <?php if( have_rows('teaser') ): ?><?php while ( have_rows('teaser') ) : the_row(); ?>

    I’ve tried:

    • get_row_index() function – it’s returning only numbers
    • get_row() – it’s not returning array item name
    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello!

    To check your problem I’ve setup a test and I wasn’t able to reproduce the problem. Here is my test example:

    Field Group: Flexible
    Fields:
    – Flexible Content (Settings: Layouts Render & Layouts Dynamic Preview)
    — Field: Repeater
    — Sub field: Text

    I’ve set a custom template.php file in my theme to take care of preview/front display. Here is the code:

    
    <pre><?php print_r(get_sub_field('repeater')); ?></pre>
    
    <br />
    
    <?php if(have_rows('repeater')): ?>
        <?php while(have_rows('repeater')): the_row(); ?>
        
            <?php echo get_row_index(); ?> - <?php echo get_sub_field('text'); ?>
        
        <?php endwhile; ?>
    <?php endif; ?>
    

    Screenshots of the result: https://imgur.com/a/oeHyZPc

    Everything just works fine. Can you please share some more informations about your template.php file or code example please?

    Thanks!

    Regards.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Any news about your problem?

    Regards.

    Thread Starter dominikkucharski

    (@dominikkucharski)

    I’m sorry. I have too much work this week. It’s on my to-do list to answer here ??

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello!

    Still no news? I still haven’t managed to reproduce your problem.

    Regards.

    @hwk-fr

    I’m facing the similar issue. You may check here: https://imgur.com/gallery/OBrw6pn

    Issue is in backend preview not in front end view.

    After adding repeater item it looks fine. Then save and reload the page. You must reload or reopen the page editor to find the issue. Issue disappears as soon as i open the block editor and close it.

    acfcloneindex is being added

    ACF Issue code screenshot

    • This reply was modified 4 years, 11 months ago by Sabbir Hasan.
    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello!

    Thanks for the report! I still haven’t managed to reproduce this problem. Please can you confirm that you’re using the latest WP + ACF Pro + ACF Extended version?

    Your second screenshot display the form fields HTML, which always include an acfcloneindex row. It is used as template for the javascript “Add row” action.

    This HTML code is perfectly normal, what is abnormal is that it is sent to the preview mode via ajax, as it should be filtered out.

    Regards.

    Check this link. https://imgur.com/a/6Z3lga5 It’s actually being sent to admin-ajax.php as param.

    I’m on latest WP + ACF Pro + ACF Extended

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Hmmm that’s weird, I’ll re-run a test. In the meantime, can you send me the PHP export of your field group that includes the flexible content + repeater fields?

    Regards.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I ran new tests, and everything works fine. Please send me your field configuration, so I can reproduce the problem.

    Regards.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello everyone,

    After going thru extensive tests, I figured out where it come from.

    This bug appear only when you enable the “Modal Edition” setting coupled with “Dynamic Preview” in your flexible content field.

    Here is the fix: In the file acf-extended\assets\acf-extended-fc.js line:228. Replace:

    
    // Flexible has Modal Edition
    if(flexible.has('acfeFlexibleModalEdition')){
    
        $layout.addClass('-collapsed');
        flexible.acfeLayoutInit($layout);
    
        return;
    
    }
    

    With:

    
    // Flexible has Modal Edition
    if(flexible.has('acfeFlexibleModalEdition')){
    
        flexible.acfeCloseLayoutInit($layout);
        return;
    
    }
    

    I’ll add the fix in the next update ??

    Regards.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Just to let you know that the latest 0.8.4 update include this fix ??

    Regards.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Dynamic Preview – repeater is returning additional row with empty fields’ is closed to new replies.