radiate-framework / framework

A WordPress plugin and theme framework
https://radiate-framework.github.io/
MIT License
4 stars 0 forks source link

PHP Fatal error when adding to the menu #171

Closed BenRutlandWeb closed 2 years ago

BenRutlandWeb commented 2 years ago

Describe the bug

PHP Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given in C:\Users\user\Local Sites\radiatetailwind\app\public\wp-content\themes\radiate-tailwind\vendor\radiate\framework\src\Http\JsonResponse.php:68

To Reproduce Steps to reproduce the behavior:

  1. Go to the appearance/menu screen
  2. Add a post/page
  3. There is no response. Console shows errors in admin-ajax.php call
  4. Error logs show more details (above)

Expected behavior method_exists to accept correct parameter types

Additional context In JsonResponse::setData method, check if data is an array before the method_exists call.