Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checks for background options before we try to use them #544

Merged
merged 2 commits into from
Aug 19, 2020

Conversation

coreymcollins
Copy link
Contributor

@coreymcollins coreymcollins commented Aug 10, 2020

Closes #543

DESCRIPTION

Adds a check to make sure we actually have background options before we try using them. Seems smart!

We're already doing this like 3 lines later with our Other Options and Display Options tabs, but background options seemed to miss the boat here.

SCREENSHOTS

look at that nice code

OTHER

  • Is this issue accessible? (Section 508/WCAG 2.0AA)
  • Does this issue pass all the linting? (PHPCS, ESLint, SassLint)
  • Does this pass CBT?

STEPS TO VERIFY

Test current

  1. Check out master
  2. Edit a block's fields to remove Background, Other, and Display options in ACF (in my test, I just removed them from the Hero)
  3. Add the block from step 2 to a page
  4. Add another block you haven't touched to the same page
  5. View the blocks on the frontend
  6. Do you see PHP notices? Cool! This is the current scenario @richaber reported.

Test this branch

  1. Check out this branch
  2. Edit a block's fields to remove background, other, and display options (in my test, I just removed them from the Hero)
  3. Add the block from step 2 to a page
  4. Add another block you haven't touched to the same page
  5. View the blocks on the frontend
  6. Do you see PHP notices? If not, it works!

DOCUMENTATION

No documentation update needed for this.

Copy link
Contributor

@gregrickaby gregrickaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Local by Flywheel
  • PHP 7.4.1
  • WordPress 5.5 RC3
  • ACF 5.9-beta-5
  • Chrome Beta

As soon as I add a block in the block editor:

[11-Aug-2020 11:52:38 UTC] PHP Notice:  Undefined index: other_options in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php on line 363
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. _s_display_expired_block_message() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:233
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_get_block_expired_class() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:383
[11-Aug-2020 11:52:38 UTC] PHP Notice:  Trying to access array offset on value of type null in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php on line 367
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. _s_display_expired_block_message() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:233
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_get_block_expired_class() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:383
[11-Aug-2020 11:52:38 UTC] PHP Notice:  Trying to access array offset on value of type null in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php on line 368
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. _s_display_expired_block_message() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:233
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_get_block_expired_class() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:383
[11-Aug-2020 11:52:38 UTC] PHP Notice:  Undefined index: other_options in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php on line 363
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. include() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:237
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_get_block_classes() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/template-parts/content-blocks/block-wds-cta.php:12
[11-Aug-2020 11:52:38 UTC] PHP  11. _s_get_block_expired_class() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:345
[11-Aug-2020 11:52:38 UTC] PHP Notice:  Trying to access array offset on value of type null in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php on line 367
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. include() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:237
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_get_block_classes() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/template-parts/content-blocks/block-wds-cta.php:12
[11-Aug-2020 11:52:38 UTC] PHP  11. _s_get_block_expired_class() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:345
[11-Aug-2020 11:52:38 UTC] PHP Notice:  Trying to access array offset on value of type null in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php on line 368
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. include() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:237
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_get_block_classes() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/template-parts/content-blocks/block-wds-cta.php:12
[11-Aug-2020 11:52:38 UTC] PHP  11. _s_get_block_expired_class() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:345
[11-Aug-2020 11:52:38 UTC] PHP Notice:  Undefined index: background_options in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf.php on line 29
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. include() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:237
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_display_block_options() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/template-parts/content-blocks/block-wds-cta.php:19
[11-Aug-2020 11:52:38 UTC] PHP Notice:  Undefined index: other_options in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf.php on line 39
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. include() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:237
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_display_block_options() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/template-parts/content-blocks/block-wds-cta.php:19
[11-Aug-2020 11:52:38 UTC] PHP Notice:  Undefined index: display_options in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf.php on line 51
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. include() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:237
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_display_block_options() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/template-parts/content-blocks/block-wds-cta.php:19
[11-Aug-2020 11:52:38 UTC] PHP Notice:  Trying to access array offset on value of type null in /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf.php on line 62
[11-Aug-2020 11:52:38 UTC] PHP Stack trace:
[11-Aug-2020 11:52:38 UTC] PHP   1. {main}() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:0
[11-Aug-2020 11:52:38 UTC] PHP   2. do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-admin/admin-ajax.php:176
[11-Aug-2020 11:52:38 UTC] PHP   3. WP_Hook->do_action() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/plugin.php:478
[11-Aug-2020 11:52:38 UTC] PHP   4. WP_Hook->apply_filters() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:311
[11-Aug-2020 11:52:38 UTC] PHP   5. acf_ajax_fetch_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-includes/class-wp-hook.php:287
[11-Aug-2020 11:52:38 UTC] PHP   6. acf_rendered_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:571
[11-Aug-2020 11:52:38 UTC] PHP   7. acf_render_block() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:298
[11-Aug-2020 11:52:38 UTC] PHP   8. _s_acf_block_registration_callback() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:345
[11-Aug-2020 11:52:38 UTC] PHP   9. include() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/inc/acf-gutenberg.php:237
[11-Aug-2020 11:52:38 UTC] PHP  10. _s_display_block_options() /Users/gregoryrickaby/Local/pdev/app/public/wp-content/themes/wd_s/template-parts/content-blocks/block-wds-cta.php:19

@coreymcollins
Copy link
Contributor Author

coreymcollins commented Aug 11, 2020

Pushed a couple of updates that should resolve those issues with the beta versions of WP and ACF you're using in your test. With these updates, I'm no longer getting anything in my debug.log file when adding a block or when viewing a page with blocks on the frontend.

For clarity, I also tested the background, display, and other options on blocks to ensure those were still pulling in properly with our new conditionals set and everything seems to be hunky dory there.

Can you give this another test?

Copy link
Contributor

@gregrickaby gregrickaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, @coreymcollins 👍🏻 Thank you!

@coreymcollins
Copy link
Contributor Author

Thanks @gregrickaby! @richaber I'd love to have you take a look at this as well since you initially reported the issue to make sure it covers all of the bases from your testing as well.

Thanks!

@coreymcollins coreymcollins merged commit 432fea1 into master Aug 19, 2020
@coreymcollins coreymcollins deleted the hotfix/#543-php74-notices branch August 19, 2020 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP 7.4 Notice: Trying to access array offset on value of type null in inc/acf.php
4 participants