Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load customizer due to unset header column widths #36

Open
W3ap0n-X opened this issue Mar 8, 2023 · 0 comments
Open

Unable to load customizer due to unset header column widths #36

W3ap0n-X opened this issue Mar 8, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@W3ap0n-X
Copy link

W3ap0n-X commented Mar 8, 2023

Unset header column widths causing 500 internal server error in customizer

To Reproduce
Issue was reported by customer and I was able to replicate it on a clone of his site. Initial cause is unknown but for whatever reason the $raw_col_widths['media'] array was empty preventing the customizer from loading. Was able to use echo and var_dump() to generate the following example from the cloned site:

type: header
var_dump(raw_col_widths):
array(4) { ["css"]=> string(412) "@media only screen and ( max-width: 767px ){.site-header header row{width:3col;width:3col;}}@media only screen and (max-width: 991px) and (min-width: 768px){.site-header header row{width:3col;width:3col;}}@media only screen and (max-width: 1199px) and (min-width: 992px){.site-header header row{width:3col;width:3col;}}@media only screen and ( min-width: 1200px ){.site-header header row{width:3col;width:3col;}}" ["media"]=> array(0) { } ["ID"]=> int(0) ["filter"]=> string(3) "raw" }

Additional context
Was able to resolve the issue by replacing the if/else statement with the following on class-boldgrid-framework-api.php:1105 :

		if ( is_string( $raw_col_widths ) ) {
			$col_width_theme_mod = json_decode( $raw_col_widths, true );
		} else {
			if ( empty( $raw_col_widths['media'] ) ) {
				$raw_col_widths = $configs['customizer']['controls']['bgtfw_header_layout_col_width']['default'];
			}
			$col_width_theme_mod = isset( $raw_col_widths['media'] )
				? json_decode( $raw_col_widths['media'], true )
				: $raw_col_widths[0]['media'];
		}
@W3ap0n-X W3ap0n-X added the bug Something isn't working label Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant