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

Color control not working #1665

Closed
daviedR opened this issue Nov 22, 2017 · 2 comments
Closed

Color control not working #1665

daviedR opened this issue Nov 22, 2017 · 2 comments
Milestone

Comments

@daviedR
Copy link

daviedR commented Nov 22, 2017

All my color controls suddenly not working on:
WordPress 4.9
Kirki version 3.0.16

When you change the value of color control, there is error message shown in console:

Uncaught TypeError: Cannot read property 'setting' of undefined

from .../kirki/controls/js/dist/script.js?ver=3.0.16:504

Looks like the foundNode is never set, because the check if ( ! _.isUndefined( wp.customize.instance( currentNode ) ) ) never returns true.

Please help

@daviedR
Copy link
Author

daviedR commented Nov 22, 2017

By the way I am using options mode.

Let's say I have a setting: my_theme_option[color_accent].

In your script, you split them to check every node. When it runs check if ( ! _.isUndefined( wp.customize.instance( currentNode ) ) ) it will always return false. Because there is no wp.customize.instance( 'color_accent' ).

The correct check is for wp.customize.instance( 'my_theme_option[color_accent]' ) instead.

I think this would work fine on theme_mods mode, as there is no split process to the setting key.

Please help

@aristath
Copy link
Contributor

Can you please try the develop branch and let me know if it works for you now? It should be ok, I just pushed a fix for this.
Using options instead of theme_mods is no something a lot of people do - and for good reason - so it doesn't get tested by many people.

Thank you for reporting this issue!
Fix will be included in 3.0.17

@aristath aristath added this to the 3.0.17 milestone Nov 22, 2017
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