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

Notice: Undefined index: compiling_options #209

Closed
alianschiavoncini opened this issue Aug 31, 2021 · 3 comments
Closed

Notice: Undefined index: compiling_options #209

alianschiavoncini opened this issue Aug 31, 2021 · 3 comments

Comments

@alianschiavoncini
Copy link

alianschiavoncini commented Aug 31, 2021

Hello,
first of all, let me say, thank you for your code, it's very useful!!!

Today, I got a fatal error due to a non existing array key $option_values['compiling_options'] at line 144, file wp-scss.php.

I replaced your wpscss_plugin_db_cleanup function with this additional code that checks if the array has the compiling_options before made any replacing.

function wpscss_plugin_db_cleanup($option_values){
	if( array_key_exists('compiling_options', $option_values) ) {
		$compiling_options = str_replace("Leafo", "ScssPhp", $option_values['compiling_options']);
		$compiling_options = str_replace("ScssPhp\\ScssPhp\\Formatter\\", "", $compiling_options);
		$compiling_options = str_replace(["Compact", "Crunched"], "compressed", $compiling_options);
		$compiling_options = str_replace("Nested", "expanded", $compiling_options);
		$compiling_options = strtolower($compiling_options);
		$option_values['compiling_options'] = $compiling_options;
	}
  return $option_values;
}

Do you guess it could be implemented in your repository?

Moreover, why do you have the plugin pending review on WP repository?

Thank you,
Alian

@shadoath
Copy link
Collaborator

shadoath commented Sep 1, 2021

Glad to hear this plugin is very useful @alianschiavoncini.

In version 2.3.0 we migrated the options for compiling. Leaving only Compressed and Expanded. Which lead me to add this check. Thank you for the additional logic to only run if needed.

As for the Pending state, that was removed yesterday! You can view this issue #203 to learn more.

@alianschiavoncini
Copy link
Author

@shadoath thank you for reply!

@shadoath
Copy link
Collaborator

shadoath commented Sep 8, 2021

Merged up. closing.

@shadoath shadoath closed this as completed Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants