themeum / kirki

Extending the customizer
https://kirki.org
MIT License
1.26k stars 327 forks source link

Version 4.0.3 breaks sites #2430

Closed untergehen0 closed 2 years ago

untergehen0 commented 2 years ago

Issue description:

I'm not a developer, so all i can provide is a log file generated with the wp-config debug mode activated and logged.

`[03-Jan-2022 15:53:33 UTC] PHP Fatal error: Uncaught Error: Class '\Kirki\Field\CSS\ReactColorful' not found in wp-content/plugins/kirki/packages/kirki-framework/module-css/src/CSS/Generator.php:170 Stack trace:

0 /wp-content/plugins/kirki/packages/kirki-framework/module-css/src/CSS.php(351): Kirki\Module\CSS\Generator::css(Array)

1 /wp-content/plugins/kirki/packages/kirki-framework/module-css/src/CSS.php(268): Kirki\Module\CSS::loop_controls('blacksilver')

2 /wp-content/plugins/kirki/packages/kirki-framework/module-css/src/CSS.php(179): Kirki\Module\CSS->print_styles()

3 /wp-includes/class-wp-hook.php(303): Kirki\Module\CSS->print_styles_inline('')

4 /wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)

5 /wp-includes/plugin.php(470): WP_Hook->do_action(Array)

6 /wp-includes/general-template.php(3015): do_action('wp_head in /wp-content/plugins/kirki/packages/kirki-framework/module-css/src/CSS/Generator.php on line 170

`

Version used: 4.0.3

(Did you try using the develop branch from GitHub? There's a chance your issue has already been addressed there)

Using theme_mods or options?

Code to reproduce the issue (config + field(s))

mapsteps commented 2 years ago

Please also notify the original theme developers of this issue. This might be something they can fix on their end. We have for now paused rolling out Kirki 4 and you can manually download & downgrade to version 3.1.9 here - https://wordpress.org/plugins/kirki/

mapsteps commented 2 years ago

@untergehen0, may I ask what theme you're using? If it's not available in the WordPress repository, can you please send us a download link (Dropbox, Google Drive, etc.) through this contact form? https://davidvongries.com/contact/

Thank you!

crazywork0407 commented 2 years ago

@MapSteps, Could you let me know what is the main updates in the new version of the Kirki plugin? I am a theme developer, And I am facing some issues with your plugin. So I have to fix it as soon as possible for our customers. But I am not sure this new version is really the final version. There is no changelog and also no descriptions. Even there are some unnecessary files for your purpose. And I will be very thankful that if you let us know the exact release date for your new version of plugin.

Thank you.

mapsteps commented 2 years ago

Hi @crazywork0407,

we have paused rolling out v4 as we have identified a few bugs that couldn't be patched in a timely manner. You can always grab the current dev-build here - https://github.com/kirki-framework/kirki/.

We are still working on some issues so if you're running into problems that have not yet been reported, please feel free to create a new issue here on GitHub.

mapsteps commented 2 years ago

I would suggest to read through the blog here - https://kirki.org/blog/

There is no changelog as v4 is a complete rewrite of the codebase. Here's another interesting read about v4 - https://aristath.github.io/wordpress/customizer/2019/02/17/planning-kirki-4

untergehen0 commented 2 years ago

Hi, yes, it is this one: https://themeforest.net/item/blacksilver-photography-theme-for-wordpress/23717875 I've contacted the author too and they are aware of the issue

jeradshepherd commented 2 years ago

We are having a problem as well. We have a custom built theme that was built using Kirki as the foundation for theme options. If I update the plugin to v4.0+, any images that existed in Customizer previously still show on the site. However, once I save anything at all in Customizer, all images break and I am not able to replace them. We had to restore from a backup and then downgrade to v3.1.9 for all of the images to come back.

contactjavas commented 2 years ago

Hi @untergehen0 , @jeradshepherd we have newer update: v4.0.13 Could you please test it?

In case it still doesn't fix the issue, then an access to the theme might be necessary for easier debugging. Thanks!

jeradshepherd commented 2 years ago

@contactjavas The update still did not fix the issue on our sites. It appears it's rewriting the output of the image URLs in a different way than before. On one particular template we needed to write the output of images inside of a repeater as wp_get_attachment_url(IMAGE_SETTING)); I can fix it by taking it out of the wp_get_attachment_url() function and just wrting IMAGE_SETTING, but we have over 100 sites with this plugin installed and that's a lot of code editing just to make it so images that used to work will now work again after a plugin update. We'll stick with v3.1.9 until this is resolved, because it's just not worth the effort.

mapsteps commented 2 years ago

@jeradshepherd, can we get a code example to replicate this? Both, for how the control is registered & how the output is handled?

mapsteps commented 2 years ago

@jeradshepherd, let's also please create a new issue for this. Thank you.

mapsteps commented 2 years ago

@jeradshepherd, there was actually a bug in what the image field outputs by default in v3.

Images can return the url, id, width or height (or an array containing all data). This didn't work properly inside the repeaters. The default inside the repeater is now also the URL (I believe in v3 it was the full array but I'm not 100% sure any more).

Regardless, it's now working as it is supposed to. So whatever is passed in choices as save_as

'choices'     => [
    'save_as' => 'url',
],

will be used. The default for the image field (inside & outside of the repeater) is now the URL.

jeradshepherd commented 2 years ago

@MapSteps Thank you for the clarification! Will note this as we figure out how to proceed. As I mentioned, we have over 100 sites with this code on it so it's going to be quite the challenge to update them all in order to use latest version of the plugin. :-) I appreciate your help and guidance!