WordPress.org

Ready to get started?Download WordPress

Forums

Preserved HTML Editor Markup
[resolved] Can't use the visual editor (27 posts)

  1. dreamdancerdesign
    Member
    Posted 1 year ago #

    I just upgraded Preserve Html plugin and all of a sudden I couldn't switch from html back to the visual editor, or even use the visual editor at all, it is completely messed up. I am using child themes to the Genesis framework.

    At first I thought it was because I was also using Advanced TinyMCE, but tested again with that plugin turned off.

    Right now I have to go back to the previous version, my clients have to use the visual editor and I need to add code to the html editor that can't be changed.

    This plugin is a lifesaver, but this version is not working for me.

    http://wordpress.org/extend/plugins/preserved-html-editor-markup/

  2. MarcusPope
    Member
    Plugin Author

    Posted 1 year ago #

    Ack! yeah that's not supposed to happen :( Firstly thanks for letting me know. Definitely sounds like a javascript error is being thrown on tab switch. Can you answer the following questions for me?

    1. browser type and version
    2. wordpress version
    3. If you know how to enable the dev toolbar for your browser, can you see if there are any script errors being reported?
    4. Is the genesis framework something I can use for free to test with?

    I should be able to fix this pretty quickly but unfortunately I'm not experiencing the same behavior. Any help would be great, and I'll see what I can do on my end this evening.

    Thanks,
    Marcus

  3. dreamdancerdesign
    Member
    Posted 1 year ago #

    Okay, let me work on those questions.

    Genesis is not a free framework, but I can look to see what javascript it is using.

    I will put up a test site too.

    Be back in a bit.

  4. dreamdancerdesign
    Member
    Posted 1 year ago #

    Wow, what a weird thing. I installed another test site and everything was working until I added Genesis Responsive Slider (I tested adding other sliders and they too messed it up), then the tabs wouldn't switch again, and the submenus on the Admin sidebar stopped working too. That happened with every test site where I had Preserved HTML Editor and a javascript slider. But only in Safari. Firefox and SeaMonkey were working.

    So I went back to the original site I was working on, and I am still having the issue of being stuck on the html tab and I can't switch. It doesn't matter if the slideshow is on or off. I tried to put the same plugins on a test site, but I can't recreate the issue. Now something else weird, I just loaded this problem site on my laptop and the site is working.

    It is so weird that it is intermittent and only Safari. I will restart my computer, maybe some Apple javascript thing is tweaked on this machine only (it is a MacPro so a good computer)

    Well, since I have been testing this for quite awhile, I do see on all the sites I tested intermittant issues when a slider is added. And only in Safari. Will report once I restart if that one site is still stuck.

  5. dreamdancerdesign
    Member
    Posted 1 year ago #

    Oops, it is getting late, I left out in the first paragraph that restarting Safari helped with some of the sites and having the slideshow turned off before installing Preserved Html editor. I got all the test sites to work, and hoping the original site that started this all will behave on this computer after a complete restart.

  6. dreamdancerdesign
    Member
    Posted 1 year ago #

    Well, a computer restart didn't fix the problem, but clearing cache and cookies did fix it.

    What exactly was happening was that the visual editor would not load in at all, it wasn't there, so clicking on the html tab would bring up the html, but it would not toggle back to visual after that on any page. And even if I didn't make any changes, if I tried to leave the page, I would be asked if I wanted to leave or stay on the page. If I turned off the Preserved HTML editor plug in off, the visual editor would load in and I could toggle between html and visual.

    Probably the javascripts were clashing. It seemed better to have the Slider turned off when installing Preserved HTML editor, then turning it on after the editor is installed.

    Must be some wonky Safari issues, I just updated it too.

    This plugin is a life saver and worth all the time to get it working (my clients also use Safari) I need to put javascript into posts for things like third party ticket sales and I also need clients to be about to use the visual editor on those pages as well. Same with some javascript galleries, I need the clients to be able to change the image order or add images while having some javascript code in the post as well. This plugin allows me to do all of that, it is just fabulous. Thank you for this plugin!

  7. MarcusPope
    Member
    Plugin Author

    Posted 1 year ago #

    Wow, this is pretty strange. I just verified it works with Safari 5.1.7 on Windows 7. I'd be really interested in seeing the js code associated with the genesis responsive slider - perhaps you could send me a jsfiddle link if it's just one file (any email to marcuspope.com will reach me.) Or if you have a staging environment that I could check out that would be perfect.

    The only other design consideration I knowingly didn't account for was if another plugin required the use of tinyMCE's 'setup' function parameter. This is usually configured via the 'tiny_mce_before_init' wp hook. The first parameter is an array, and if another plugin sets the array key 'setup' to some other value my plugin will either not work or break the other plugin depending on execution order. I didn't see a quick solution to this potential problem because the infrastructure does not support an array of setup events, just one value, and I was under a time crunch to finish the work. I verified that TinyMCE Advanced didn't conflict, so I left it at that. If you could verify that hook either doesn't exist or doesn't alter the 'setup' key for me that would help me isolate the problem.

    Thanks for helping out with this,
    Marcus

  8. dreamdancerdesign
    Member
    Posted 1 year ago #

    The new Safari for Mac does have some big changes, no doubt that is what was happening. But for some reason I didn't try other browsers. Also I use Advanced TinyMCE, but turning it off had no effect, the built in visual editor wouldn't load.

    It is a strange thing for sure and will only effect very few people. But I will email you links to my staging site that I set up. I only set it up to test this plugin so you can work with it all you wish.

  9. MarcusPope
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for helping out with a live staging site. It's unfortunate that Apple decided to drop support of Safari on windows, but I have an old mbpro I can dust off to test with. I'm going to be a little delayed on this ticket because my cat had a seizure two days ago and I took off from work to care for her. The good news is she's better, but it will probably take me a couple days to catch up on work. (Not to mention my wife and I are still preparing for the birth of our daughter! :D)

    But given everything you supplied, I should be able to resolve this for you pretty quickly once I jump on it.

  10. dreamdancerdesign
    Member
    Posted 1 year ago #

    Oh, I didn't know Apple isn't supporting Safari on Windows, that is too bad. But most likely very few Windows folks used it.

    I think this issue is very isolated, I am wondering if it just wasn't something that didn't load in correctly on my Mac Pro, my MacBook Pro wasn't having the issue, but hard to say since I was doing so many things (installing, uninstalling, turning off, turning on different plugins) while testing. I wonder too if the auto update had something to do with it, the issue cleared up once I deleted cookies and cleared the cache. Obviously it shouldn't be high priority to fix since it has cleared up for me, and maybe I was the only one with the issue!

    Glad to hear you cat is better, had health issues with my pet pot belly pig, after many vet visits all is well now, but it is all consuming when pets get sick, I am still catching up on projects from this spring as I couldn't work either. Best wishes on the upcoming birth too.

    Let me know if there is anything else I can do to help.

  11. nikoskleidis
    Member
    Posted 1 year ago #

    This has also happened to me. I am using the latest version of wordpress 3.4.1, windows as OS and chrome as browser. I can't use the visual editor also. I have deactivated the plugin and all went back to normal. If I can't use the plugin now is there a way to download a previous version just to get it work again. It is a very useful plugin and it is exactly what I was looking for!

  12. dreamdancerdesign
    Member
    Posted 1 year ago #

    I did get it to finally work, but until I could, I also went back to the previous version, I have a copy that I uploaded here

    I hope the issue can be found and fixed, this plugin is really needed for anyone needing to put advanced html in wordpress

  13. nikoskleidis
    Member
    Posted 1 year ago #

    thank you very much. It worked like a charm!!

  14. MarcusPope
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks @dreamdancerdesign for posting the old version, I'm shocked WP.org doesn't offer links to past versions, but alas I could have pushed a copy from the svn repository. I'll be sure to add links to past version on my support site once it's up and running.

    @Nikoskleidis - I'll have this problem fixed soon, glad to hear it's a problem for you on windows which is my primary development platform. It would really help out if you could list the other plugins you're using on your site. If you prefer to email me you can do so to any address at marcuspope.com.

    Thanks!
    -Marcus

  15. dreamdancerdesign
    Member
    Posted 1 year ago #

    Hi Marcus, glad it was okay to post your plugin on my site. I know you are super busy right now, wanted to help out.

  16. abbyj
    Member
    Posted 1 year ago #

    I had a problem after updating. In Visual Editor Advanced TimeMCE buttons did not display. Displayed content was WHITE - so it looked like not there but just hightlight. However - it was the html markup. I deactivated Ultimate TinyMCE and reactivated. Did not fix. Deactivated Preserved HTML Editor - fixed the problem. Reactivated Preserved HTML - did not work again.
    I like your plugin. Please fix it!
    I'm on WordPress 3.4.1 and Firefox 14.0.1.

  17. MarcusPope
    Member
    Plugin Author

    Posted 1 year ago #

    @abbyj - can you try a different browser like chrome or IE to see if the problem still happens? I'm noticing a trend with firefox, but can't seem to reproduce it in my testing. But I'm hoping to knock this out this weekend and will publish a fix as soon as I can.

  18. abbyj
    Member
    Posted 1 year ago #

    it's ok in chrome and IE.
    still problem in firefox.
    thanks!

  19. MarcusPope
    Member
    Plugin Author

    Posted 1 year ago #

    Awesome, very good news to help me isolate issues. Are you also unable to switch between tabs like the other users? One thing to ensure is having the page load on the html tab and seeing if you cab switch.

    I normally would ask so much testing from my users but I'm still not able to reproduce these problems :(. Thanks again!

  20. abbyj
    Member
    Posted 1 year ago #

    no problem -happy to help.
    I can switch to the html tab but cannot switch back to visual.

  21. MarcusPope
    Member
    Plugin Author

    Posted 1 year ago #

    Ok the problem is definitely due to browsers caching the javascript file from version 1.1. I simulated a browser caching issue by copying the version 1.1 of admin.js to my test server and the behavior matched exactly with what everyone is saying.

    @dreamdancerdesign - thanks for everything you've been really helpfull and I'll be sure to thank you and @abbyj in the plugin notes.

    So, if you all could try clearing your web cache for your site, with version 1.2 of my plugin installed, you should be good to go. There are various ways to clear the browser cache for each browser, so google will be your friend if you don't know how.

    I can also solve this problem programmatically so I will publish an updated version that will not require you to clear your web cache for future updates. I'm pretty shocked the plugin installer doesn't cache-bust js files automatically on update.

    I'll hold off on marking the topic as resolved until I hear some confirmation of the fix.

    Thanks again to everyone,
    Marcus

  22. dreamdancerdesign
    Member
    Posted 1 year ago #

    Great news, and it does make sense too, and why it was intermittent. I was only happening in the browser I was using to do the update. An Safari does hold on to things in its cache.

    I am happy to help and good job figuring out the issue.

  23. MarcusPope
    Member
    Plugin Author

    Posted 1 year ago #

    Good News Everyone! I've been watching futurama and fixing bugs. If you update to version 1.3 you should have no problems using the features in version 1.2. And I've added a feature to prevent a browser from using a cached version on plugin update (but it will still cache for performance after the first download.)

    I've also added support for inline JavaScript and CSS to html tags. This support is experimental and requires disabling some internal wordpress filters (outlined in the readme), but it's there for those who need it.

    If you still have problems with version 1.3, go ahead and try clearing your browser cache anyway, but I'm pretty confident in the stability of this version.

    Thanks,
    Marcus

  24. dreamdancerdesign
    Member
    Posted 1 year ago #

    Just used the update to the plugin on my cache happy Safari, no issues at all. (nor any cache clearing needed). Will need to check out the inline Javascript and for sure the inline CSS that I use quite a bit.

    Three cheers for Futurama, and ten thousand "thank you's" to Marcus.

  25. Underscorefunk
    Member
    Posted 1 year ago #

    I've been struggling with this problem even with the latest version. I get the following error when I click on the Visual Tab:

    Uncaught TypeError: Cannot call method 'apply' of undefined wp-tinymce.php:2

    I noticed an error that might highlight why this is happening...

    [blocked] The page at https://XXXXXXXXXXX/wp-admin/post.php?post=165954&action=edit ran insecure content from http://XXXXXXXXXXX/wp-content/plugins/preserved-html-editor-markup/admin.js?v=1.5&ver=3.3.1.

    Disabling the preserved html editor plugin resolves the issue. Strangely enough, this only seems to pop up in Chrome...

    Any ideas?

    By the way, awesome plugin. The fact that this even exists makes me smile.

    Peace,
    John

  26. Underscorefunk
    Member
    Posted 1 year ago #

    I made an edit to sb_preserved_markup.php on Line 309 replacing WP_PLUGIN_URL with the plugins_url() function return.

    wp_enqueue_script('emc2-pm-admin-js', WP_PLUGIN_URL .'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__))."admin.js?v=".$cachebuster);

    became

    wp_enqueue_script('emc2-pm-admin-js', plugins_url() . '/' . str_replace(basename( __FILE__),"",plugin_basename(__FILE__))."admin.js?v=".$cachebuster);

    Worked like a charm! :D

  27. MarcusPope
    Member
    Plugin Author

    Posted 1 year ago #

    Hey John, thanks for the helping hand in debugging the problem. I'm glad you like the plugin, and I've made your suggested fix which will be published soon.

    It's very interesting that the WP_PLUGIN_URL doesn't account for the scheme change - as it was the http content served over an https connection that caused Chrome to complain.

    plugins_url() fixes that, so I went ahead and changed it on this plugin and another one I wrote.

    Thanks,
    Marcus

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic