Visual Editor & TinyMCE Problems with 2.5 – Check realpath() works
-
After going through the suggestions in the following threads, I still had a problem with the tinyMCE editor.
WP 2.5 – WYSIWIG Problem – TinyMCE does not start..
2.5 and TinyMCE not working in visual mode
Visual Editor Not Working on Upgrade
2.5 Visual Editor/TinyMCE problemsInspecting the code versus the output of the tiny_mce_config.php I noticed that the javascript files (tiny_mce_ext.js and tiny_mce.js) were not being added to the response. Which in turn caused the tinyMCEPreInit.start() to raise an error and the HTML editor to stop working.
On our shared server the function realpath() existed, but was returning a boolean false. This messed up the rest of the code in the function getFileContents($path). Temporarily commenting out the first 2 lines of the function fixed the problem:
`if ( function_exists(‘realpath’) )
$path = realpath($path);`After running some simple tests, it was found realpath() was not working anywhere on our server so I contacted our server’s support and they found the problem. One of the higher level directories did not have the permissions set correctly which caused realpath() to always return False.
I’ve now reverted back to the original code and it works fine, but suggest that the following code be used in future tinyMCE versions.
`if ( function_exists(‘realpath’) && ($newpath = realpath($path)) )
$path = $newpath;`I hope this helps someone out there.
- The topic ‘Visual Editor & TinyMCE Problems with 2.5 – Check realpath() works’ is closed to new replies.