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

jQuery not defined error with Markdown enabled #9989

Closed
andreasnrb opened this issue Aug 7, 2018 · 1 comment
Closed

jQuery not defined error with Markdown enabled #9989

andreasnrb opened this issue Aug 7, 2018 · 1 comment
Assignees
Labels
[Feature] Markdown [Status] Invalid [Type] Bug When a feature is broken and / or not performing as intended
Milestone

Comments

@andreasnrb
Copy link

Steps to reproduce the issue

  1. Use plugin Elementor
  2. Activate Markdown support in JetPack
  3. Edit page with Elementor

What I expected

No error messages in console.

What happened instead

jQuery not defined.

Propsed fix.

Don't assume jQuery is loaded before calling it. See

jQuery( function() {

@brbrr brbrr added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Markdown labels Aug 7, 2018
@zinigor zinigor added this to the 6.5 milestone Aug 9, 2018
@zinigor zinigor self-assigned this Aug 9, 2018
@abidhahmed abidhahmed modified the milestones: 6.5, 6.6 Aug 28, 2018
@jeherve
Copy link
Member

jeherve commented Sep 6, 2018

I ran some tests, and it appears that Elementor itself removes most scripts that usually load on the edit screen, including jQuery, to then reload it later on its own. To remove all those scripts, they do the following:
https://github.com/pojome/elementor/blob/0cfd51b929e9bbd8ddcd495350d443767a863124/includes/editor.php#L105-L109
elementor/elementor@5879b80

Jetpack's Markdown module, however, adds its JavaScript by hooking into another hook, after_wp_tiny_mce, to indicate that its script must load after TinyMCE scripts, that also rely on jQuery.
Since Elementor does not remove anything that's hooked there yet, it creates the issue. I created a PR here to let the Elementor folks know and offer a fix:
elementor/elementor#5686

Closing this issue now.

@jeherve jeherve closed this as completed Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Markdown [Status] Invalid [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

No branches or pull requests

5 participants