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

Revolution slider compatibility #1110

Closed
andrejarh opened this issue Mar 21, 2018 · 14 comments
Closed

Revolution slider compatibility #1110

andrejarh opened this issue Mar 21, 2018 · 14 comments

Comments

@andrejarh
Copy link

Latest development version causes Revolution slider plugin not to work. The WordPress.org version of CMB2 works fine. When i updated to the latest version, this is the error the slider reports:
screen shot 2018-03-21 at 09 27 46

Rev slider is not really a codebeauty masterpice, so it is quite possible the problem is on their end.
As soon as I switch to the old CMB2, this error is gone.

Anyway, I just wanted to let you know about this issue.

@jtsternberg
Copy link
Member

Do you have a textarea_code field type on this page?

@jtsternberg
Copy link
Member

What is the full url to the css_editor.js file? It looks like Revolution slider is likely using an old version of CodeMirror. WordPress now bundles CodeMirror in core, so they should update their plugin to work with that version.

@andrejarh
Copy link
Author

andrejarh commented Mar 21, 2018

Hi, you are probably right. They are using their own version of CodeMirror ( ver. 2.35 ) packed with their plugin. I haven't seen the textarea_code field on this site though.

screen shot 2018-03-21 at 16 57 50

this is the whole path of their css_editor.js:
screen shot 2018-03-21 at 17 01 18

It is loaded from the revslider plugin...

@pareshsojitra
Copy link

Hi,

I'm also getting the same issue, is there any suggestion on where is the problem ? Either Revolution or CMB2 Need to fix the problem ?

Thank you.

@tw2113
Copy link
Contributor

tw2113 commented May 27, 2018

@pareshsojitra can you confirm questions asked by justin in #1110 (comment) ?

@MyLoVeSunITy
Copy link

+1 for this problem. what should happen to you to eliminate this problem?

@wayheming
Copy link

wayheming commented May 28, 2018

+1 http://prntscr.com/jnhy4y

@MyLoVeSunITy works for me in plugins/cmb2/includes/CMB2_JS.php

remove if ( function_exists( 'wp_enqueue_code_editor' ) ) { $l10n['defaults']['code_editor'] = wp_enqueue_code_editor( array( 'type' => 'text/html', ) ); }

http://prntscr.com/jnhil1

@Moultrex
Copy link

It causes trouble also with Wp Export and Wp All import plugins from www.wpallimport.com

If you comment out this code

/wp-content/plugins/cmb2/includes/CMB2_JS.php

line: 234

Everything works again.

@tw2113
Copy link
Contributor

tw2113 commented May 28, 2018

I realize i'm going to come off pointing fingers, but unless CMB2 is somehow using this function wrong, or storing the return results wrong, then it's more an issue coming from these other plugins. They need to also be made aware of the errors coming up from someone potentially using a core WordPress function in these various screens. Specifically wp_enqueue_code_editor.

I'm willing to be wrong though, don't get me wrong, but the found "solution" is just removing a newly added feature for CMB2.

@pareshsojitra
Copy link

  • I think the problem is : codemirror library is getting loaded in all pages in WP admin and because of that its affecting other plugin pages/features like WP import, Revolution Slider etc.

  • To avoid conflict it should be load in CMB Page/Features only.

@tw2113
Copy link
Contributor

tw2113 commented May 29, 2018

Logically, limiting where possible makes total sense, but the question ends up being how to do that successfully, when CMB2 can be added to both post editor screens as well as term editor screens. All of which may have these other libraries/plugins included as well.

We could check, if not done already, if there's a field type that uses this codemirror lib before adding, however once there is, the same conflict is potentially going to show up. There still needs to be compatibility resolution from these other items as well.

@jtsternberg
Copy link
Member

2.4.2 addresses this issue and only enqueues WP's code editor functionality if a textarea_code field is found on the page.

@pareshsojitra
Copy link

Thank you so much for your fixes

@jtsternberg
Copy link
Member

jtsternberg commented May 29, 2018

That being said, like Michael said, this conflict only partially mitigates the issue.. The version of code mirror in core is the one that all plugins need to be using to avoid conflicts. Please spread the word to those other plugins.

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

7 participants