Support

Account

Home Forums General Issues TinyMCE error

Solving

TinyMCE error

  • Hi,

    I’m experiencing a strange error with my WYSIWYG ACF’s. I have multiple WYSIWYG fields on my posts. Most of them are normal text fields but there are 3 WYSIWYG fields. But only one loads correct the other once don’t show the WYSIWYG options. I don’t know if this is due to the new WP update 4.6. But I haven’t seen this before.

    If I open my console there is an error: `TypeError: this.getDoc(…) is undefined
    tinymce.min.js:11:26948`

    I uninstalled the “stand alone” TinyMCE Advanced plugin but this didn’t do the trick. Is anyone experiencing the same problem or is there someone that knows how to fix this?

    Thanks!

  • Do you still have this problem ?
    I have exactly the same error and can’t find the solution.. if anyone has an idea to fix this please let me know.

  • I just tested this on a site with only ACF and WP, I tested with both ACF4 and ACF5. I’m not getting this error. Have you tried deactivating plugins or changing themes?

    Are the WYSIWYG fields at the top level or are they in a repeater or something? What are the settings for the fields. If you give me some more information I’ll try more testing if I am able to. I don’t have the flex field for ACF 4 though so I can only go so far with that.

  • Thanks for your help,

    I am trying to make it work with qtranslate (I have qtranslate-X and acf qtranslate). So I disabled qtranslate and the ACF WYSIWYG field works well even if the error still appears in js console. But when I reactivate qtranslate, all the WYSIWYG fields are missing the toolbar.

  • I am having similar issues when ACF Pro and the EasyRecipe plugin is installed. Loading the Visual editor for a post with a recipe inserted is giving the same error message as above, breaking lots of things on the page from working properly (including saving the post at all).

    Disabling *either* plugin removes the error.

    This just happened after the WP4.6 upgrade.

  • Note this happens with no custom fields set up at all – replicated locally just with both plugins installed, and a recipe inserted into the content. Refresh and you’ll see the error.

    Given this prevents posts from saving at all, a quick fix would be appreciated 🙂 (It could be an issue in the other plugin, but..)

  • A quick debug is showing EasyRecipe is using tinyMCE.activeEditor which is being set to acf_content instead of the main editor.

    Looks like this is affecting a number of other plugins too all of which are trying to come up with workarounds, but it seems ACF is the problem:

    https://github.com/dsifford/academic-bloggers-toolkit/issues/115

    https://wordpress.org/support/topic/tinymce-problem-when-acf-and-abt-plugins-are-active?replies=5

  • I deactivated all plugin’s except ACF and now it works. Then I activated all my plugins one by one and every time I checked if the WYSIWYG fields where back to normal and after checking all one at a time it now (looks) like its working again.

    Maybe this will fix your issues as well?

  • This is only a guess…

    More than likely one of the other plugins is loading and older version of a jQuery plugin than the one used in ACF.

    Why does deactivating them and activating them make it start working? The order that plugins are loaded is dependent on the order they were activated. When you deactivate everything else and only have ACF active, and then reactivate them, the other plugins load after ACF. This could effect the order in which scripts are enqueued. If ACF enqueues the version of a JS file before another plugin then that is the version that will be used.

    For those that are having this problem I would look all of the plugins, searching the code for wp_enqueue_script and wp_register_script I would look for anywhere that ACF and another plugin are enqueuing the same script handle and then I would look at the versions of the JS files that each plugin is loading. This will narrow down what might be causing the conflict and then we might be able to figure out where it needs to be corrected.

  • Hi John,

    That’s not the issue for me.

    Have debugged further and can 100% confirm ACF + WP4.6 is working different to ACF + WP4.5.3 in a way that is breaking other plugins.

    Here is a completely minimal test case. Install a brand new version of WP4.6 and WP4.5.3, activating ACF.

    Also install this extremely minimal plugin: http://www.cre8d-design.com/testplugin.zip . All this does is add a test javascript file to the mce_external_plugins filter which alerts the tinyMCE active editor when loaded.

    Edit the Hello World post.

    In 4.5.3, the test js file will alert “no active editor”. In 4.6, it will alert “acf_content”.

    Any plugin which uses tinyMCE.activeEditor in this way is therefore going to change behavior and likely break, like EasyRecipe and other plugins mentioned above.

    WP4.6 had a tinymce related update which may or may not be relevant: https://make.wordpress.org/core/2016/07/29/editor-changes-in-4-6/

  • Since this is for ACF 4, please submit an issue here https://github.com/elliotcondon/acf or by submitting a new ticket https://support.advancedcustomfields.com/new-ticket/. This will get to the developer faster. Over on GitHUb would likely be the best choice.

  • ACF5, not ACF4, though I suspect it affects both.

  • I’ve reported this to the developer on ACF5, like I said, if you’re seeing issues in 4, which have also been reported, the best place to report them is on the github repo for 4.

  • Hi guys

    Thanks for the bug reports

    I’ve spent some time debugging these tinymce issues and believe to have found a fix!
    If possible, can you please download and test the latest build of ACF PRO (5.4.3 RC1)?
    ​
    1. Login to your account online: http://www.advancedcustomfields.com/my-account
    2. Click on the ‘see all versions’ link next to your license
    3. Download the latest 5.4.3 RC1 version​​

    ​​Please let me know how you go. I’ll be able to release this as a public update when I hear back form a few other tickets

  • hi!

    For me the problem persists in wordpress 4.6.

    With the update 5.4.3 the problemas persists.
    With 5.4.2 all works fine.

    For now I donwgrade the plugin to 5.4.2 for continue working.

    Thaks a lot!

  • Hi again!

    I see that in WordPress 4.6 with ACF 4.5.3, I disable the “Disable the visual editor when writing” in the user option, the editor works fine, if I enable the option “Disable the visual editor when writing” the problems comes back again.

    I hope I help with the comment.

    Thanks a lot!

  • Can I just add more fuel to the fire here, maybe my info will help identify any issues.

    What I am experiencing is on acf_forms frontend. If The user is defaulted to the ‘visual tab’ on the WYSIWYG editor when the page loads the WYSIWYG fails to fully instantiate. However if the user is defaulted to the ‘text’ tab and then clicks on the ‘visual’ it loads fine.

    See attached screen grab of my console error when you click on the ‘visual’ tab when the WYSIWYG when you the page load brings in the ‘visual’ tab as default

  • I did what Juanka said

    I see that in WordPress 4.6 with ACF 4.5.3, I disable the “Disable the visual editor when writing” in the user option, the editor works fine, if I enable the option “Disable the visual editor when writing” the problems comes back again.

    indeed it stops working when the visual editor option is active, thanks Juanka at least this is something.

    Curious thing is that the option was not activated to begin with, so i activated it and saved the profile, then deactivated it and it started to work again.

  • Hi guys

    Thanks for the bug report.
    I believe I have found and fixed the issue.

    If possible, can you please download and test the latest build of ACF PRO?
    1. Login to your account online: http://www.advancedcustomfields.com/my-account
    2. Click on the ‘see all versions’ link next to your license
    3. Download the latest 5.4.4-RC1 version​​

    Please let me know if this solves the problem and I will release a patch.

    Thanks
    Elliot

  • hi again!

    Yeeees! I test the 5.4.4-RC1 and the problem is fixed!

    Thanks a lot Elliot.

  • Hi @juanka

    Thanks for the feedback. I’ve gotten positive results from a few users now and have released 5.4.4!

    Cheers
    E

  • Hi Elliot. My issue with tinymce seems to have persisted unfortunately. See my above post.

    Just to confirm my scenario for debugging:

    • If visual editor is default tab it’s not working (switching to text tab works)
    • If text tab is default, I can switch to visual tab and it works.
    • It’s a form in a user Add/Edit form. However I am pulling the acf_form to a front end template page and behavior is the same.
    • I’ve tried deactivating all my plugins apart from ACF. No change.
    • I’ve tried removing all other jQuery based fields from my field group. No change.
    • WYSIWYG working fine on pages flexible fields. (don’t get that at all)

    Let me know if there is anything else I can do to help debug from my end. I’m out of ideas here.

  • Hi @magicstick

    Thanks for the reply.
    There is still too much ambiguity around this issue.

    Can you please create a support ticket with a more details description of the issue:
    http://support.advancedcustomfields.com/new-ticket/

    – does the issue occur editing a post?
    – does the issue occur editing a user?
    – does the issue occur editing a acf_form()?
    – What is needed to replicate the issue? A simple wysiwyg field? Or within a repeater?
    – have you disabled all other plugins / themes to test conflict?

    Thanks
    Elliot

  • Hi Everyone,
    I have the same issue with ACF pro 5.6.3 / WordPress 4.8.2.
    Like @magicstick :
    If visual editor is default tab it’s not working (switching to text tab works)
    If text tab is default, I can switch to visual tab and it works.
    It’s a form in a user Add/Edit form. However I am pulling the acf_form to a front end template page and behavior is the same.
    I’ve tried deactivating all my plugins apart from ACF. No change.
    I’ve tried removing all other jQuery based fields from my field group. No change.
    WYSIWYG working fine on pages flexible fields. (don’t get that at all)

    I was expecting for a resolution with the last version of ACF last week but nothing change.
    Console give me some informations about the problem but I don’t know how to resolve it.
    I see that there is a simple problem of instance between each other:

    acf-input.min.js:3:22419ReferenceError: Can’t find variable: instanceId
    tinymce.min.js:14:3486TypeError: undefined is not an object (evaluating ‘a[b]’)

    Do I have to open a ticket or this problem should be resolved in an other way?

    Thanks a lot for your reply.

    Ced

  • Hi @mrced

    Thanks for the bug report.
    Yes, can you please open a support ticket:
    https://support.advancedcustomfields.com/new-ticket/

    If possible, can you setup a testing site online to replicate the issue?
    This will be a major help for our support team to debug and fix the problem.

    Thanks
    E

Viewing 25 posts - 1 through 25 (of 26 total)

The topic ‘TinyMCE error’ is closed to new replies.