moderntribe / square-one

Modern Tribe's legacy WordPress framework for the classic editor.
GNU General Public License v2.0
89 stars 20 forks source link

[SQONE-609]: Fix regression in Tabs Controller #1045

Closed defunctl closed 2 years ago

defunctl commented 2 years ago

https://moderntribe.atlassian.net/browse/SQONE-609

What does this do/fix?

Whoops\Exception\ErrorException: Undefined array key "tab_panel_classes" in file /application/www/wp-content/plugins/core/src/Templates/Components/Abstract_Controller.php on line 39
Stack trace:
  1. Whoops\Exception\ErrorException->() /application/www/wp-content/plugins/core/src/Templates/Components/Abstract_Controller.php:39
  2. Whoops\Run->handleError() /application/www/wp-content/plugins/core/src/Templates/Components/Abstract_Controller.php:39
  3. Tribe\Project\Templates\Components\Abstract_Controller->parse_args() /application/www/wp-content/themes/core/components/tabs/Tabs_Controller.php:70
  4. Tribe\Project\Templates\Components\tabs\Tabs_Controller->__construct() /application/www/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php:143
  5. DI\Definition\Resolver\ObjectCreator->createInstance() /application/www/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php:71
  6. DI\Definition\Resolver\ObjectCreator->resolve() /application/www/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php:71
  7. DI\Definition\Resolver\ResolverDispatcher->resolve() /application/www/vendor/php-di/php-di/src/Container.php:390
  8. DI\Container->resolveDefinition() /application/www/vendor/php-di/php-di/src/Container.php:199
  9. DI\Container->make() /application/www/wp-content/plugins/core/src/Templates/Components/Abstract_Controller.php:21
 10. Tribe\Project\Templates\Components\Abstract_Controller->factory() /application/www/wp-content/themes/core/components/tabs/tabs.php:8
 11. require() /application/www/wp/wp-includes/template.php:772
 12. load_template() /application/www/wp/wp-includes/template.php:716
 13. locate_template() /application/www/wp/wp-includes/general-template.php:204
 14. get_template_part() /application/www/wp-content/themes/core/components/blocks/tabs/tabs.php:22
 15. require() /application/www/wp/wp-includes/template.php:772
 16. load_template() /application/www/wp/wp-includes/template.php:716
 17. locate_template() /application/www/wp/wp-includes/general-template.php:204
 18. get_template_part() /application/www/wp-content/themes/core/blocks/tabs/tabs.php:13
 19. require() /application/www/wp/wp-includes/template.php:772
 20. load_template() /application/www/wp/wp-includes/template.php:716
 21. locate_template() /application/www/wp/wp-includes/general-template.php:204
 22. get_template_part() /application/www/vendor/moderntribe/tribe-libs/src/ACF/Block_Renderer.php:28
 23. Tribe\Libs\ACF\Block_Renderer->render_template() /application/www/wp-content/plugins/core/src/Blocks/Blocks_Subscriber.php:29
 24. Tribe\Project\Blocks\Blocks_Subscriber->Tribe\Project\Blocks\{closure}() /application/www/wp/wp-includes/class-wp-hook.php:309
 25. WP_Hook->apply_filters() /application/www/wp/wp-includes/class-wp-hook.php:331
 26. WP_Hook->do_action() /application/www/wp/wp-includes/plugin.php:474
 27. do_action() /application/www/vendor/moderntribe/tribe-libs/src/ACF/Block_Config.php:71
 28. Tribe\Libs\ACF\Block_Config->Tribe\Libs\ACF\{closure}() /application/www/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:424
 29. acf_render_block() /application/www/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:367
 30. acf_rendered_block() /application/www/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php:680
 31. acf_ajax_fetch_block() /application/www/wp/wp-includes/class-wp-hook.php:307
 32. WP_Hook->apply_filters() /application/www/wp/wp-includes/class-wp-hook.php:331
 33. WP_Hook->do_action() /application/www/wp/wp-includes/plugin.php:474
 34. do_action() /application/www/wp/wp-admin/admin-ajax.php:187

QA

Tests

Does this have tests?

defunctl commented 2 years ago

Thanks for catching this @defunctl. I checked the other blocks where I removed sink classes and think this is the only case where I accidentally pulled out the entire default.

@LayaTaal thanks for checking the others! I was doing a PHP8 upgrade on another project, and was testing every block and ran into this.