Support

Account

Home Forums ACF PRO Flexible Content issue after upgrading

Solved

Flexible Content issue after upgrading

    • raabe

    • July 22, 2014 at 8:10 pm

    I have an issues after upgrading my existing 4.3.8 to 5.0.1. The problem is the flexible content field. The accordion of some fields does not work.

    I have tried to find a solution for that. And it seems that every field within a layout needs a starting ‘field_’ in the ‘key’.

    This does not work:

    
    $layout_pageteaser = array (
                            'key' => 'key_module_pageportlets',
                            'label' => 'Page Teaser',
                            'name' => 'module_pageportlets',
                            'display' => 'row',
                            'min' => '',
                            'max' => '',
                            'sub_fields' => array (
                                array (
                                    'key' => 'module_pageportlets_headline',
                                    'label' => 'Headline',
                                    'name' => 'headline',
                                    'instructions' => 'This is the main headline of your content.',
                                    'type' => 'text',
                                    'default_value' => '',
                                    'placeholder' => '',
                                    'prepend' => '',
                                    'append' => '',
                                    'formatting' => 'none',
                                    'maxlength' => '',
                                ),  
                                array (
                                    'key' => 'module_pageportlets_pages',
                                    'label' => 'Pages',
                                    'name' => 'pageportlets_pages',
                                    'type' => 'relationship',
                                    'instructions' => 'Select the pages that you want to show as teaser.',
                                    'column_width' => '',
                                    'return_format' => 'object',
                                    'post_type' => array (
                                        0 => 'page',
                                    ),
                                    'taxonomy' => array (
                                        0 => 'all',
                                    ),
                                    'filters' => array (
                                        0 => 'search',
                                    ),
                                    'result_elements' => array (
                                        0 => 'post_title',
                                    ),
                                    'max' => '',
                                ),
                            ),
                        );

    This works:

    $layout_pageteaser = array (
                            'key' => 'key_module_pageportlets',
                            'label' => 'Page Teaser',
                            'name' => 'module_pageportlets',
                            'display' => 'row',
                            'min' => '',
                            'max' => '',
                            'sub_fields' => array (
                                array (
                                    'key' => 'field_module_pageportlets_headline',
                                    'label' => 'Headline',
                                    'name' => 'headline',
                                    'instructions' => 'This is the main headline of your content.',
                                    'type' => 'text',
                                    'default_value' => '',
                                    'placeholder' => '',
                                    'prepend' => '',
                                    'append' => '',
                                    'formatting' => 'none',
                                    'maxlength' => '',
                                ),  
                                array (
                                    'key' => 'field_module_pageportlets_pages',
                                    'label' => 'Pages',
                                    'name' => 'pageportlets_pages',
                                    'type' => 'relationship',
                                    'instructions' => 'Select the pages that you want to show as teaser.',
                                    'column_width' => '',
                                    'return_format' => 'object',
                                    'post_type' => array (
                                        0 => 'page',
                                    ),
                                    'taxonomy' => array (
                                        0 => 'all',
                                    ),
                                    'filters' => array (
                                        0 => 'search',
                                    ),
                                    'result_elements' => array (
                                        0 => 'post_title',
                                    ),
                                    'max' => '',
                                ),
                            ),
                        );

    After adding “field_” the accordion works.

    But this is a big problem for existing content, because the key changed and already saved values will not be loaded correctly into the field.

    To solve that, I would need to change every field name in post_meta manually and add the “field_” prefix. This would be a hard job for all installations.

    Can you add a downgrade fix to an upcoming version? Do you see a chance/solution for that?

    Have a good day,

    Stephan

    • raabe

    • July 22, 2014 at 8:12 pm
    This reply has been marked as private.
    • raabe

    • July 23, 2014 at 11:34 pm

    Hi,

    I’ve just add the “field_” to the flexible content items. All Layouts are working correctly.

    Surprising for me is that also the existing values will be loaded correctly.
    That’s good.

    Does that make sense or do you see an for me unknown side effect?

    Stephan

    • Elliot

    • July 30, 2014 at 2:07 pm

    Hi guys

    Thanks for the bug report and field group info.
    I’ve just included a fix for this issue in the latest version of ACF PRO 5.0.3

    Cheers
    E

    • raabe

    • August 2, 2014 at 1:28 am

    It works great. The update was successfully.

    Thanks….

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

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.