MarieComet / mc-acf-flexible-template

WordPress plugin makes it possible to save the ACF flexible content fields as templates
71 stars 20 forks source link

Plugin Breaks When Updating ACF To Version 5.7.11 #15

Closed jroy813 closed 5 years ago

jroy813 commented 5 years ago

When upgrading the the newest ACF the ACF Templates turn into one large text field instead of the normal flexible content fields (Screenshot Below) 2019-02-11_1644 . This also breaks things on the front-end. I'm unsure of the exact cause, but here is the link to the ACF release: https://www.advancedcustomfields.com/blog/acf-5-7-11-release/ .

Please help with this as soon as you can.

Love the plugin and would like to keep using it!

MarieComet commented 5 years ago

Can you explain "This also breaks things on the front-end."?

jroy813 commented 5 years ago

I'm calling the ACF Flexible layout field as an array and looping through the array items to display the content based on the field_name and the value associated with it. I think some of the key-value pairs were changed with the update. Some of the items in the array have empty key's now. This is causing php errors and warnings and the images and content aren't showing correctly. Here is a var_dump before and after:

Before Update: 1 => array (size=3) 'acf_fc_layout' => string 'main_content_block' (length=18) 'customize_section_content' => string 'Custom' (length=6) 'content_block_group' => array (size=3) 'main_content' => array (size=2) ... 'sidebar_content' => array (size=6) ... 'template_part_version' => string '1' (length=1) 2 => array (size=3) 'acf_fc_layout' => string 'callouts' (length=8) 'customize_section_content' => string 'Custom' (length=6) 'callout_group' => array (size=2) 'cta_tile' => string '' (length=0) 'template_part_version' => string '1' (length=1)

After Update: 1 => array (size=2) 'acf_fc_layout' => string 'main_content_block' (length=18) '' => array (size=1) '' => string '1' (length=1) 2 => array (size=2) 'acf_fc_layout' => string 'callouts' (length=8) '' => array (size=1) '' => string '1' (length=1)

MarieComet commented 5 years ago

Thanks for details. I'm not sure I'm undertanding from where your var_dump come from. Are you displaying your ACF templates (from acf-flexible-template plugin) in front-end ?

MarieComet commented 5 years ago

After some searchs, it seems there is changes in acf_maybe_get_field function, which cause get_field_object return nothing. I see there is other problems with the new fields API, related to this version on ACF support forum. I'm waiting for some fixes from ACF. For now just going back to 5.7.10 version.

MarieComet commented 5 years ago

A fix has been published by ACF, please download 5.7.11 again and let me know if it's ok for you.

jroy813 commented 5 years ago

I re-installed ACF 5.7.11 and it now works. Looks like they did fix whatever was wrong. Thank you very much for looking into it!

lewebsimple commented 5 years ago

ACF Pro 5.7.12 seems to have broken things again...

MarieComet commented 5 years ago

@lewebsimple Hi, tested with ACF Pro 5.8.0 and no issue on my side, can you confirm ?

jroy813 commented 5 years ago

Hey Marie,

Everything seems to be working on my end :)

On Thu, May 16, 2019 at 3:01 AM Marie Comet notifications@github.com wrote:

@lewebsimple https://github.com/lewebsimple Hi, tested with ACF Pro 5.8 and no issue on my side, can you confirm ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarieComet/mc-acf-flexible-template/issues/15?email_source=notifications&email_token=AB2UHO7FDUHAXV7BHRIGGS3PVUBF7A5CNFSM4GWUQNRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVQ3W7I#issuecomment-492944253, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2UHO36X43C6VPHTFMOGHLPVUBF7ANCNFSM4GWUQNRA .

MarieComet commented 5 years ago

I'm closing this issue. Please feel free to open a new issue if needed.