- This topic has 5 replies, 2 voices, and was last updated 3 years, 8 months ago by Tom.
-
AuthorPosts
-
August 13, 2020 at 12:35 pm #1401506Liviu
Starting with WordPress 5.5 GP Premium plugins elements and page-header started throwing javascript errors due to missing declaration of wpColorPickerL10n. The full error is below:
Uncaught ReferenceError: wpColorPickerL10n is not defined
at h.<computed>.<computed>._create (color-picker.min.js?ver=5.5:2)
at h.<computed>.<computed>.h.isFunction.a.<computed> [as _create] (load-scripts.php?c=0&load[chunk_0]=underscore,shortcode,utils,jquery,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jquery-ui-core,jquery-u&load[chunk_1]=i-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.5:45)
at h.<computed>.<computed>._createWidget (load-scripts.php?c=0&load[chunk_0]=underscore,shortcode,utils,jquery,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jquery-ui-core,jquery-u&load[chunk_1]=i-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.5:45)
at new h.<computed>.<computed> (load-scripts.php?c=0&load[chunk_0]=underscore,shortcode,utils,jquery,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jquery-ui-core,jquery-u&load[chunk_1]=i-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.5:45)
at HTMLInputElement.<anonymous> (load-scripts.php?c=0&load[chunk_0]=underscore,shortcode,utils,jquery,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jquery-ui-core,jquery-u&load[chunk_1]=i-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.5:45)
at Function.each (load-scripts.php?c=0&load[chunk_0]=underscore,shortcode,utils,jquery,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jquery-ui-core,jquery-u&load[chunk_1]=i-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.5:8)
at n.fn.init.each (load-scripts.php?c=0&load[chunk_0]=underscore,shortcode,utils,jquery,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jquery-ui-core,jquery-u&load[chunk_1]=i-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.5:8)
at n.fn.init.h.fn.<computed> [as wpColorPicker] (load-scripts.php?c=0&load[chunk_0]=underscore,shortcode,utils,jquery,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jquery-ui-core,jquery-u&load[chunk_1]=i-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.5:45)
at i.ready (load-scripts.php?c=0&load[chunk_0]=mce-view,imgareaselect,image-edit,wp-hooks,heartbeat,customize-base,customize-controls,customize-widgets,accordion,wp-sanitize,c&load[chunk_1]=ustomize-nav-menus,jquery-ui-slider,jquery-touch-punch,iris&ver=5.5:13)
at Object.<anonymous> (load-scripts.php?c=0&load[chunk_0]=mce-view,imgareaselect,image-edit,wp-hooks,heartbeat,customize-base,customize-controls,customize-widgets,accordion,wp-sanitize,c&load[chunk_1]=ustomize-nav-menus,jquery-ui-slider,jquery-touch-punch,iris&ver=5.5:13)As far as I checked, the faulty JS file is wp-color-picker-alpha.js and its minified counter-part, wp-color-picker-alpha.min.js. Can you please update this in order for it to be fully compatible to 5.5? Right now the graphic customizer in the admin section is unusable due to this.
August 13, 2020 at 1:03 pm #1401556TomLead DeveloperLead DeveloperHi there,
This is fixed in GP Premium 1.11.0, which is available for download/update in your Dashboard.
Let me know if you need more info ๐
August 13, 2020 at 1:09 pm #1401559LiviuHello, Tom.
Thank you for the fast response, however please note that I’m using version 1.11.2 of the GP Premium plugin. I’ve cleared Autoptimize’s cache to rule out possible caching issues and made sure the browsers doesn’t serve a cached version of the files. I’ve check the files on the server and there are references of the wpColorPickerL10n in three JS files and one PHP file:
gp-premium/elements/assets/admin/wp-color-picker-alpha.js
gp-premium/elements/assets/admin/wp-color-picker-alpha.min.js
gp-premium/page-header/functions/js/wp-color-picker-alpha.min.js
gp-premium/elements/class-metabox.phpAugust 13, 2020 at 1:38 pm #1401590TomLead DeveloperLead DeveloperWe define
wpColorPickerL10n
inclass-metabox.php
, as WP 5.5 no longer does by default.So we still reference that variable in
wp-color-picker-alpha.js
, however we manually define it to prevent errors: https://www.screencast.com/t/SoiCzQkd3ASeI’ll have to take a look at Page Headers – that’s a deprecated module, so it may have been missed.
August 13, 2020 at 2:17 pm #1401642LiviuTom, I really feel bad about this. The error is not on your side – I’ve just figured this out that it had something to do with my custom logic of creating brotli compressed version of JS files which did not get updated once I updated to 5.5. So basically the browser was receiving old Core WordPress core JS files instead of the new ones, causing the errors reported initially.
I’ve fixed this on my side and now the admin section is working properly again. I will mark this thread as closed, sorry for storming this on you without first checking everything on my side of things.
August 13, 2020 at 2:21 pm #1401648TomLead DeveloperLead DeveloperNo worries! Caching can be tricky.
Glad it’s all working now ๐
-
AuthorPosts
- You must be logged in to reply to this topic.