Support

Account

Home Forums Bug Reports ACF 5.7.11 Breaks Image Field Reply To: ACF 5.7.11 Breaks Image Field

  • Hi @elliot,

    No worries I’ve followed your steps above and updated, however the issue persists unfortunately.

    So here’s the output of get_field_objects():

    Array
    (
        [flex] => Array
            (
                [ID] => 52
                [key] => field_5c59ba9a49e2c
                [label] => Flexible Content
                [name] => flex
                [prefix] => acf
                [type] => flexible_content
                [value] => Array
                    (
                        [1] => Array
                            (
                                [acf_fc_layout] => text_image_card
                                [title] => About Example
                                [text] => Duis pulvinar sed mauris at tempus. Maecenas at dapibus nisi, sed congue velit.
                                [link] => Array
                                    (
                                        [title] => 
                                        [url] => https://example.test/
                                        [target] => 
                                    )
    
                                [image] => Array
                                    (
                                        [ID] => 82
                                        [id] => 82
                                        [title] => ladies
                                        [filename] => ladies.jpg
                                        [filesize] => 127509
                                        [url] => https://example.test/wp-content/uploads/2019/02/ladies.jpg
                                        [link] => https://example.test/home/ladies/
                                        [alt] => 
                                        [author] => 3
                                        [description] => 
                                        [caption] =>  
                                        [name] => ladies
                                        [status] => inherit
                                        [uploaded_to] => 19
                                        [date] => 2019-02-06 14:12:57
                                        [modified] => 2019-02-06 14:12:57
                                        [menu_order] => 0
                                        [mime_type] => image/jpeg
                                        [type] => image
                                        [subtype] => jpeg
                                        [icon] => https://example.test/wp-includes/images/media/default.png
                                        [width] => 800
                                        [height] => 800
                                        [sizes] => Array
                                            (
                                                [thumbnail] => https://example.test/wp-content/uploads/2019/02/ladies-150x150.jpg
                                                [thumbnail-width] => 150
                                                [thumbnail-height] => 150
                                                [medium] => https://example.test/wp-content/uploads/2019/02/ladies-300x300.jpg
                                                [medium-width] => 300
                                                [medium-height] => 300
                                                [medium_large] => https://example.test/wp-content/uploads/2019/02/ladies-768x768.jpg
                                                [medium_large-width] => 768
                                                [medium_large-height] => 768
                                                [large] => https://example.test/wp-content/uploads/2019/02/ladies.jpg
                                                [large-width] => 800
                                                [large-height] => 800
                                            )
    
                                    )
    
                                [text_side] => right
                                [card_colour] => navy
                            )
    
                    )
    
                [button_label] => Add Content
                [min] => 
                [max] => 
                [_name] => flex
                [_valid] => 1
            )
    
    )

    And so we have a flex file which routes to the relevant flex component:

    if (have_rows('flex')) {
        while (have_rows('flex')) {
            the_row();
            include locate_template('components/flex/content-' . get_row_layout() . '.php');
        }
    }
    

    And in my content-text_image_card.php file I’m using:

    $image = get_sub_field('image');
    $link = get_sub_field('link');

    $link works, $image doesn’t. If I change the name of the image field from image to card_image then get_sub_field('card_image'); works.

    As previously mentioned, the naming could certainly be better on my part, however it’s kind of set on a lot of our projects so changing now is a big job.

    Thanks