• Resolved Eusebiu Oprinoiu

    (@eusebiuoprinoiu)


    Hello!

    The latest plugin update causes a fatal error on PHP 8.2.
    It can be seen while accessing the Settings page.

    An error of type E_ERROR was caused in line 129 of the file /wp-content/plugins/code-snippets/php/settings/class-setting-field.php. Error message: Uncaught TypeError: Code_Snippets\Settings\Setting_Field::render_checkbox(): Argument #3 ($checked) must be of type bool, null given, called in /wp-content/plugins/code-snippets/php/settings/class-setting-field.php on line 163 and defined in /wp-content/plugins/code-snippets/php/settings/class-setting-field.php:129

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Strange, it looks like something’s gone awry in your settings configuration.

    I’ll make sure this is patched in the next release, but for the meantime you should also be able to resolve this by resetting the settings.

    Thread Starter Eusebiu Oprinoiu

    (@eusebiuoprinoiu)

    I don’t think this is an error specific to me.
    This is most likely due to stricter type declarations introduced in PHP 8.2.
    I manage websites for multiple people and all that run on PHP 8.2 have this issue.

    I also tried to reinstall the plugin, making sure to remove all options from the database, but the issue persists.

    I’m also seeing this error with PHP 8.2 whenever I click on the Settings page just after “Hide Upgrade Menu” field label and whenever I hit the Code Editor or Debug tabs within the Settings area. There’s no way to save the settings – the settings form crashes midway.

    Uncaught TypeError: Code_Snippets\Settings\Setting_Field::render_checkbox(): Argument #3 ($checked) must be of type bool, null given, called in wp-content/plugins/code-snippets/php/settings/class-setting-field.php on line 163 and defined in wp-content/plugins/code-snippets/php/settings/class-setting-field.php:129

    Also, please do something about the new Go Pro button in the WP Admin menu being a similar red-orange color to admin alerts. It’s terrible.

    Plugin Author Shea Bunge

    (@bungeshea)

    Thanks @seanconklin – we’ll have this fixed in the next patch.

    Apologies for the distracting button – I’ll pass the feedback along to our marketing person. When we get those settings issues fixed you should be able to hide it entirely.

    Plugin Author Shea Bunge

    (@bungeshea)

    @eusebiuoprinoiu I develop the plugin on PHP 8.1/8.2, and didn’t encounter this issue, which is why I’m so confused it’s occurring for you.

    Either way, I have a fix ready, and will be releasing a patch shortly. Apologies for the annoyance this has caused.

    Thread Starter Eusebiu Oprinoiu

    (@eusebiuoprinoiu)

    No problem.
    I appreciate you took the time to fix it.

    As for the “Go Pro” button, I’m with Sean. The current implementation is very intrusive. It should be a normal menu link, not styled like a button. It looks out of place in the admin UI.

    Thanks for working on the giant orange button. Here I was coding at night time with the Yonce (dark) theme and while trying to concentrate on code the big orange button just draws my eye away from the code. I had to stick a Post-It note to the computer screen to dull its bright color!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal Error on PHP 8.2’ is closed to new replies.