Support » Plugin: Simple Custom CSS and JS » CodeMirror js conflict with WordPress Core

Viewing 8 replies - 1 through 8 (of 8 total)
  • manesvenom

    (@manesvenom)

    It seems the workaround is to de-register the built-in version codemirror.min.js included in the WordPress when using Simple CSS and JS code plugin to open/edit file.

    open admin-screens.php in custom-css-js/includes
    go to line 133
    add
    wp_deregister_script('wp-codemirror');

    Cheers,
    Venom

    Plugin Author Diana Burduja

    (@diana_burduja)

    The plugin works alright with the WordPress 5.1.1. I get no conflict with the WP core codemirror library. By default the WP core codemirror library should load only on specific pages, like the WP Admin -> Plugins -> Plugin Editor or the WP Admin -> Themes -> Theme Editor page.

    It could happen that there is another plugin that recklessly requires the WP core codemirror library to be loaded on all admin pages and this leads to the conflict on your website. Could you give me a list of active plugins on your website so I can check them up?

    The solution with the wp_deregister_script line looks reasonable, but it would be better to test things before adding the line. On my test website I see no conflict, therefore currently I cannot test anything.

    manesvenom

    (@manesvenom)

    Hi,

    I found out which plugin is in conflict with you plugin. Once I disabled the following plugin. It works fine.

    Page Builder by SiteOrigin by SiteOrigin Version 2.10.2

    Cheers,

    Venom

    • This reply was modified 4 months ago by  manesvenom.
    Plugin Author Diana Burduja

    (@diana_burduja)

    I’m sorry, I still cannot replicate the conflict. On my test website there is no issue with the Page Builder by SiteOrigin plugin.

    Hello Everyone. I have the same problem when i want to open my wordpress customization menu. And when i want to open that, there are not any customization menu items anymore. I got these errors:
    ////////////////////////
    Uncaught TypeError: CodeMirror.fromTextArea is not a function
    at child.ready (code.js?ver=5.2.2:30)
    at Object.<anonymous> (customize-controls.js?ver=5.2.2:3626)
    at i (jquery.js?ver=1.12.4-wp:2)
    at Object.add [as done] (jquery.js?ver=1.12.4-wp:2)
    at child.initialize (customize-controls.js?ver=5.2.2:3623)
    at child.api.Class (customize-base.js?ver=5.2.2:98)
    at child [as constructor] (customize-base.js?ver=5.2.2:39)
    at new child (customize-base.js?ver=5.2.2:39)
    at Object.<anonymous> (customize-controls.js?ver=5.2.2:7839)
    at Function.each (jquery.js?ver=1.12.4-wp:2)
    /////////////////////////////
    and the codemirror functon in my code.js file has these codes:
    ////////////////////////////
    editor = CodeMirror.fromTextArea( element[0], {
    value: control.setting._value,
    mode: language,
    lineNumbers: true,
    lineWrapping: true,
    theme: control.params.choices.theme,
    height: control.params.choices.height + ‘px’
    });
    ///////////////////////////
    I’m not a professional web developer,So i’ll appreciate it if anyone can describe the problem and maybe solutions as simple as possible. Thank you.

    • This reply was modified 1 week, 6 days ago by  mdglmdi.
    Plugin Author Diana Burduja

    (@diana_burduja)

    On what page or pages do you get the errors?

    What other plugins do you have installed on your website?

    This is not the same issue as reported by manesvenom. It deserves a topic of its own, but we continue the discussion here, if you want.

    Thanks Diana. Yes you’re right. Excuse me. I’m getting this error when i want to open customizer page in WP. There are some plugins installed before but as I said i tried to deactivate and update them one by one, but the same peoblem exist still. I will appreciate it if you show me one of your magic solutions to solve this problem.

    Plugin Author Diana Burduja

    (@diana_burduja)

    What do you mean by “and the codemirror functon in my code.js file has these codes”. Where do you have this code.js file?

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.