Search code examples
wordpresspagelineswordpress-5.5

WordPress conflicting with PageLines


I have noticed that I am unable to edit my wordpress pages via PageLines5 after update to WP 5.5.

These are the errors in my site when try to edit a page:

Uncaught ReferenceError: wp is not defined at color-picker.min.js:2

Uncaught TypeError: a(...).wpColorPicker is not a function at editing.js:5

The Plugin "Enable jQuery Migrate Helper" didn't help me.


Solution

  • after wordress update, Page editor (Pagelines framework) can't edit because a(...).wpColorPicker is not a function at editing.js bloc script

    solution : look at the file edit.js in wp-content/plugins/pl-platform/engine/ui/js/edit.js after that unminify a file, finally make edit before :

    .each(function () {
    a(this)
        .wpColorPicker({
            change: function (b, c) {
                var d = a(this);
                d.val(d.iris("color")).trigger("keyup");
                var e = _.debounce(
                    function () {
                        d.trigger("blur");
                    },
                    300,
                    { leading: !1 }
                );
                e();
            },
        })
        .addClass("is-ready loaded");
    })
    ...
    

    })

    instead of (adding ...hasOwnProperty('wpColorPicker')

    .each(function () {
    if(a(this).hasOwnProperty('wpColorPicker')) {
        a(this)
            .wpColorPicker({
                change: function (b, c) {
                    var d = a(this);
                    d.val(d.iris("color")).trigger("keyup");
                    var e = _.debounce(
                        function () {
                            d.trigger("blur");
                        },
                        300,
                        { leading: !1 }
                    );
                    e();
                },
            })
            .addClass("is-ready loaded");
        }
    })
    ...
    

    })

    refresh your page make sure your file is updated, i suggest to delete cache browser done. it work for me