Support

Account

Home Forums Bug Reports WP 5.5 color picker breaks front-end form

Solving

WP 5.5 color picker breaks front-end form

  • Hi there,

    I updated WP to 5.5 and I am using the latest version of ACF PRO, now when my front-end form loads a color picker field, the console throws the following error:

    Uncaught ReferenceError: wp is not defined on color-picker.js?ver=5.5:14

    Resulting in another error on acf-input.min.js?ver=5.9.0:1:

    Uncaught TypeError: e.wpColorPicker is not a function

    It doesn’t happen on the back-end though. It seems to be a problem on the Color picker script’s side. Other plugins face the same issue, but their temporary solutions don’t seem to work here.

    Is there any way to (temporarily) fix this for the acf_form function?

    • kcalv

    • September 1, 2020 at 6:58 pm

    Hi Guys

    I can confirm that WP 5.5 causes JS errors for the color picker on the acf_form_head() function;

    Tested with no other plugins and twenty twenty theme.

    Your hep is appreciated

  • This should be corrected in WP 5.5.1

  • Hi John,

    Thanks for reaching out!

    Sadly, it isn’t working in 5.5.1 either. I’ve submitted a support ticket and the team is looking for a solution. Downgrading WP to a version prior to 5.5 seems to be the fix for now.

    • kcalv

    • September 2, 2020 at 11:56 pm

    Yes the JS Error issue persists after updating to 5.5.1

  • From what I’ve found the 5.5 update broke millions of sites. This is why I generally do not update until after the first minor release for a major release and sometimes not even then. I just wait and let everyone else update so that the bugs can be reported and hopefully fixed. I’m working on a new site now that I must revert to 5.4… because fool that I am I keep sites in development up to date to make sure things will not break 😛

  • Having same problem and i ended in the same as kcalv said about acf_form_head();

    And for what i could see the problem start since this change on the wp core:

    https://github.com/WordPress/WordPress/commit/7e7b70cd1ae5772229abb769d0823411112c748b#diff-9c3519f4870fac83dc0dbf18cb6bd4c4

    See how it´s added a new “__ = wp.i18n.__;” into the ColorPicker var.

    I guess many other changes in core about i18n and how js uses translations are the problem here, sine i saw many other plugins that are having the same not defined “wp”.

    For what i see this is a change that affects many other things, all related on how js uses translations, basicly this:

    This removes the usage of wp_localize_script() for passing translations to the script and instead adds the translatable strings in the script directly through the use of wp.i18n and its utilities.

    Hope this help to find the solution.

  • It has been fixed in the 5.9.1 update, thanks Elliot and team!

  • I can confirm “wp is not defined” it´s fixed on ACF 5.9.1.
    Thanks!

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.