L&L CodeMirror conflict with Max Mega Menu plugin

Hi,

Just to point at a conflict between Loops & Logic and the Max Mega Menu Pro plugin, involving CodeMirror:

  • Max Mega Menu uses WP CodeMirror to edit HTML in the backend
  • With L&L enabled, impossible to enter or display existing code in MMM HTML inputs
  • A JS error is returned in the console: Uncaught TypeError: b.verify is not a function
  • The issue disappears once L&L is disabled

Thanks for reporting this. At first glance, what you’re describing sounds similar to this other reported issue which is caused by the HTML Lint library in CodeMirror. We’re working on a fix that should come out in an upcoming release.

Hi @benjamin,

Thanks for your interest, yes it looks like one of the CodeMirror lib loaded by L&L is involved in this conflict.

I temporarily fixed the problem by dequeuing the libs, which allows to edit MMM HTML widget again:

add_action( 'wp_print_scripts', function() {
	wp_dequeue_script('tangible-codemirror');
	wp_dequeue_script('tangible-codemirror-csslint');
	wp_dequeue_script('tangible-codemirror-htmlhint');
	wp_dequeue_script('tangible-codemirror-jshint');
	wp_dequeue_script('tangible-codemirror-jsonlint');
	wp_dequeue_script('tangible-codemirror-scsslint');
}, 20 );

i’ll try to limit the dequeuing to the Lint lib you’re pointing at and see if it works.

[Update]
All the libs above need to be dequeued except tangible-codemirror-jshint that can be kept.
Otherwise, the b.verify is not a function error triggers.

Thank you for the issue report, @avanti. As @ben said, we’ve identified the problem - a conflict with multiple versions of HTML Lint library being loaded - and a fix will be included in the next release.

Great, thank you @eliot !