Page 1 of 1

Missing TinyMCE editor after CMSMS 1.1 install in sub-directory [SOLVED]

Posted: Tue Jul 17, 2007 2:20 pm
by michelG
After first-time install of CMSMS 1.1 in a sub-directory, the TinyMCE editor will not display.

I get the following javascript error in my browser's error console:

Error: missing ; before statement
Source File: http://www.mydomain.com/cmsms/modules/T ... config.php
Line: 2, Column: 9
Source Code:
Fatal error:  main(): Failed opening required '\include.php' (include_path='.;c:\php\pear') in D:\inetpub\mydomain\cmsms\modules\TinyMCE\tinyconfig.php on line 5



Server: Windows 2003, MySQL5, PHP5

Re: Missing TinyMCE editor after CMSMS 1.1 install in sub-directory

Posted: Tue Jul 24, 2007 1:31 pm
by michelG
Hello everybody.

I didn't receive any reply on this issue.

It seems to be a broken link generated by the tinyconfig.php file:  it cannot find the include.php file where -- if I understand correctly -- the tinyMCE javascript is called. FYI, all my other modules (including CMKeditor) and system in general work correctly.

Elijah made available a new version of tinyMCE in the posting below, but it didn't fix the problem.
http://forum.cmsmadesimple.org/index.ph ... 680.0.html

Is this a bug in the tinyconfig file? Is this something I can fix myself if someone can telll me what to fix?

Re: Missing TinyMCE editor after CMSMS 1.1 install in sub-directory

Posted: Tue Jul 24, 2007 4:34 pm
by Elijah Lofgren
Hi michelG,

Sorry you didn't get a reply, as I'm sure you understand we're all quite busy. ;)

I would try making the following change to modules/TinyMCE/tinyconfig.php and see if it works:

Code: Select all

Index: cmsmadesimple/modules/TinyMCE/tinyconfig.php
===================================================================
--- cmsmadesimple/modules/TinyMCE/tinyconfig.php        (revision 129)
+++ cmsmadesimple/modules/TinyMCE/tinyconfig.php        (working copy)
@@ -1,7 +1,10 @@
 <?php

 header("Content-type:text/javascript; charset=utf-8");
-$path = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
+$path = dirname(dirname(dirname(__FILE__)));
+// Uncomment the 2 lines below to aid in debugging:
+// print_r($_SERVER);
+// echo $path;
 require $path . DIRECTORY_SEPARATOR . 'include.php';
 // Adapted from http://www.php.net/manual/en/function.session-id.php#54084
 // session_id() returns an empty string if there is no current session, sotest if a session already exists before calling session_start() to prevent error notices:

It could be that "$_SERVER['SCRIPT_FILENAME']" is not set correctly on your server.

Hope this helps,

Elijah

Edit: You could also try hard coding it like this:

Code: Select all

require 'D:\inetpub\mydomain\cmsms\include.php';
:)

Edit 2: Please tell me if using dirname(__FILE__) works and I'll commit the change to TinyMCE, since dirname(__FILE__) seems to be used most places like this in CMSMS. ;)

Re: [Solved] Missing TinyMCE editor after CMSMS 1.1 install in sub-directory

Posted: Tue Jul 24, 2007 6:30 pm
by michelG
Elijah Lofgren wrote: Please tell me if using dirname(__FILE__) works and I'll commit the change to TinyMCE, since dirname(__FILE__) seems to be used most places like this in CMSMS. ;)
Thanks Elijah. That did the trick. Thank you for spending your time to debug this.

Michel

Re: Missing TinyMCE editor after CMSMS 1.1 install in sub-directory [SOLVED]

Posted: Tue Jul 24, 2007 6:44 pm
by Elijah Lofgren
Thanks, fix applied: http://viewsvn.cmsmadesimple.org/viewsv ... e&view=rev should hopefully be in CMSM 1.1.1 :)

Re: Missing TinyMCE editor after CMSMS 1.1 install in sub-directory

Posted: Sun Aug 05, 2007 3:29 pm
by theredspecial
hmmm... doesn't appear to solve the problem in all cases  :(
i uncommented those 2 lines, but don't get any error messages