Type check error for plugin settings options in PHP 7.4.3
-
(sorry, just found that it is duplicated to post)
Issue on PHP 7.4 – Trying to access array offset on value of type boolThere is a type checking error after upgrading to PHP 7.4.3
Because$this-options
returns false by default which does not have an initial value store to DB. New PHP does not bare it and displaying error instead.For tempoary workaround is going to settings, save once to create settings in DB.
In
wp-smartcrop.php
// I think just adding a checking for the option value before assigning can do. wp_localize_script( 'jquery.wp-smartcrop', 'wpsmartcrop_options', array( 'focus_mode' => $this->options['focus-mode'] // <==== php type check error because a boolean false is not any error and cannot access the key ) );
- This topic was modified 4 years, 11 months ago by .
- This topic was modified 4 years, 11 months ago by .
- This topic was modified 4 years, 11 months ago by .
- This topic was modified 4 years, 11 months ago by . Reason: gramma and formatting
- This topic was modified 4 years, 11 months ago by .
- This topic was modified 4 years, 11 months ago by .
- This topic was modified 4 years, 11 months ago by .
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Type check error for plugin settings options in PHP 7.4.3’ is closed to new replies.