P2: PHP Notice for breathe_color_styles()
- Dominant language
- JavaScript
- Stars
- 338
- Forks
- 56
- Avg merge
- 24m
- Merged PRs (30d)
- 16
Description
I hope this is the right place to report a PHP Notice with p2-breathe
I am getting the following PHP Notice with Revision 57498.
> Trying to access array offset on value of type bool in inc/customizer.php line 61, 62, 64 & 65
The reason for this is this code. The `get_theme_mod()` is returning `false` by default when no settings have been saved and `isset()` is checking if the variable is null.
```php
$options = get_theme_mod( 'breathe_theme_options', null );
if ( ! isset( $options ) )
return;
```
A possible solution would be
```php
$options = get_theme_mod( 'breathe_theme_options', null );
if ( ! $options )
return;
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Open inc/customizer.php and locate breathe_color_styles(), then reproduce the notice with no saved theme settings so get_theme_mod() returns false. Done means the PHP Notice no longer occurs in that case; no test file is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100