splittingred / TinyMCE

TinyMCE integration for MODx Revolution.
http://svn.modxcms.com/docs/display/ADDON/TinyMCE
35 stars 19 forks source link

Insert Link Button opens dialog box "Internal Server Error" #29

Closed damonbauer closed 13 years ago

damonbauer commented 13 years ago

When trying to link a document using TinyMCE's Insert/Edit Link function, the popup displays "The page cannot be displayed because an internal server error has occurred." (FF).
IE says the page cannot be displayed. The path to the "missing" file is: assets/components/tinymce/jscripts/tiny_mce/plugins/modxlink/link.php - but I know it's not missing, I can see it on the server (and it has permissions).

The thing is, if I change TinyMCE to look for link.htm instead of link.php, it works fine.

pixelchutes commented 13 years ago

I can confirm this is happening for me as well in MODx Revolution 2.0.7-pl with TinyMCE 4.1.2-pl.

I have even force-removed TinyMCE packages, cleared cache, and cannot get the link dialog to open:

Pop-up URL address bar reads: http://www.domain.com/modx-subdir/assets/components/tinymce/jscripts/tiny_mce/plugins/modxlink/link.php?v=207pl

Apache access_log shows 404 error, but I have confirmed this file path is correct?

"GET /modx-subdir/assets/components/tinymce/jscripts/tiny_mce/plugins/modxlink/link.php?v=207pl HTTP/1.1" 404

After reviewing the permissions, it seems that "-rw-rw-r-- " was the problem. Here was my fix:

chmod 644 assets/components/tinymce/jscripts/tiny_mce/plugins/modxlink/link.php

:) I believe this is related to: Mod SuPHP permission requirements

That said, the correct way to fix this was to update "new_file_permissions" under System Settings from: 0664 to 0644, uninstall TinyMCE, then re-install.

Upon learning this, I realized this is not an issue with TinyMCE at all, and the link dialog works just as expected ;)

sirspacey commented 13 years ago

I'm having the same issue - but I'm not understanding your solution pixelchute:

I have no setting for new_file_permissions under System Settings.

Isn't 0664 a broader permission set than 0644?

Mark-H commented 13 years ago

I can also confirm it.

Setting the permissions doesn't work in my case though..

/assets/components/tinymce/jscripts/tiny_mce/plugins/modxlink/editor_plugin.js

Line 17

link.php -> link.htm

Solves it for me, except for the search failing (again with an internal server error 500)...

damonbauer commented 13 years ago

I changed the following:

assets/components/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js & assets/components/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js.

If I recall correctly (it's been a few months since I did this), I had to change the same thing here. These 2 files are referencing link.htm as well as ../modxlink/

Hlight commented 13 years ago

I have 2 sites (modx revo-2.0.7-pl) running on the same server with same basic settings. One site the TinyMCE link button gives a '500 Internal Server Error' and the other site's link button works perfectly as expected.

I took the files from the working site and copied them over the the non-working site, cleared cache, and still no work. So it is very hard for me to believe that hacking the code (as mentioned above) is going to work.... I still tried it and no work. So I'm left with the same problem, TinyMCE link button gives '500 Internal Server Error'.

I feel like this issue should be 're-opened' :)

sirspacey commented 13 years ago

I would agree with this - I had two sites it wasn't working on, I hadn't changed anything on them, and then it was. Can't explain it.

Hlight commented 13 years ago

how long did you wait before you noticed they were working again?

Hlight commented 13 years ago

Okay, my server admin found the problem and fixed it for me:) IT IS TO DO WITH PERMISSIONS... in this case my /assets/components" was writeable by group! I don't know why it was like this but it was... maybe the previous installation of MODx had something to do with it.

If any one else has this problem check your folder permissions all the way up the chain.

pixelchutes commented 13 years ago

@Hlight,

Glad you got it working :)

As I mentioned above, I believe this is related to suPHP permission requirements.

By understanding suPHP permission requirements, you'll find that all directories must be chmod to 755 and all files chmod 644...not just the TinyMCE files, but everything in your web root. In your case, a group writable directory is all it takes to trigger the Error 500, and in some cases, the 404.

To prevent this issue moving forward (especially when installing Extras via the package manager), ensure you have the following MODx System Settings:

* new_file_permissions
* new_folder_permissions

http://rtfm.modx.com/display/revolution20/new_file_permissions

http://rtfm.modx.com/display/revolution20/new_folder_permissions

When running suPHP, you'll want to set to 0644 and 0755. I think early versions of MODx Revolution may have defaulted to 0664, but am not certain. In my case, I simply added these settings, uninstalled then reinstalled the components and was able to fix entirely within MODx Revo Manager.

Mark-H commented 13 years ago

I just fixed a different issue by modifying permissions, and then I got a notification about your response.. lol.

Thanks for the update, this will definitely help in the future!

MarkOdey commented 10 years ago

Hello guys, I consider this issue not really fixed. In internet explorer I get this 404 error and my boss is very annoyed by it. All my file permission is at 644 and folder permission 755.