• Marco Pelloni

    (@marcopelloni)


    Here’s the error message:

    PHP Fatal error: Uncaught TypeError: ksort(): Argument #1 ($array) must be of type array, null given in /public/wp-content/plugins/gforms-addon-for-country-and-state-selection/includes/functions.php:71

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author JC

    (@coder426)

    Hi there,

    Could you please share more details on the issue?

    It works fine on my side so issue could be any other plugin or theme you are using?

    If you can share more details, then I can better help you on this.

    Thanks

    Thread Starter Marco Pelloni

    (@marcopelloni)

    Hey JC,

    It wouldn’t have to do with another plugin or theme. You’re using ksort on line 71 of functions.php. ksort only takes an array, and on occasion the assoc array was passing through null.

    Since this plugin doesn’t update often, we just made an adjustment to the file to check if the array key exists. If you update your plugin with the following, your users won’t get the fatal error:

    if (array_key_exists($country_request, $newcountry)) {
      ksort($newcountry[$country_request]);
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Fatal error, crashing site’ is closed to new replies.