1

Topic: Image not loading when trying to edit / crop it.

Hi!

I just recently bought a license for MCImageManager & MCFileManager. I've been trying to debug a problem that is very confusing. I and another team member have spent a couple hours off and on trying to figure out what is causing this problem.

Notes:
1) It is a Drupal 7 setup.
2) The following is happening on my remote testing server.
3) The modules work perfectly fine on my local laptop environment (Windows 7 / WAMP).
4) In order to get the text editor to load in the first place, I had to modify the "DRUPAL_ROOT" constant in "plugins/DrupalAuthenticator/DrupalAuthenticator.php":

-- FROM: define(DRUPAL_ROOT, MCMANAGER_ABSPATH . "../../../../../");
-- TO: define(DRUPAL_ROOT, MCMANAGER_ABSPATH . "../../../../../../");

Steps:
1) I click on "Insert / Edit Image" and/or "Insert Image"
2) I see images that I've uploaded available in the dialog.
3) I click on the arrow-btn at the bottom right of an image and then choose "Edit"
4) A new dialog loads but the image doesn't appear.
5) I checked the URL that is being called for loading the image in FireBug's "Net" panel and it shows that the URL is malformed... I.e.: instead of being "http://mysite-dev.devdomain.com/sites/default/files/filename.jpg" it is trying to load "http://mysite-dev.devdomain.comefault/files/image-small.jpg?rnd=1328575555000".
6) Please note the lack of the slash and directory names "***.com/sites/default" in the URL above.

Thank you very much for your support and wonderful module/plugin!

2

Re: Image not loading when trying to edit / crop it.

Sounds like the preview.wwwroot setting needs to be specified to the wwwroot of the site. Sometimes it fails to auto detect this setting.

Best regards,
Spocke - Main developer of TinyMCE

3

Re: Image not loading when trying to edit / crop it.

Hi Spocke!

Thanks for getting back to me so soon!

I've implemented the following settings; unfortunately, I'm still receiving the exact same error. Please note, I've been making sure to perform a Drupal clear-cache after each change to the module settings.

Here's the path to where MCImageManager is installed:
sites/all/modules/contrib/MCImageManager

Here's the value I've put into preview.wwwroot:
'/var/www/html/majorisdev/docroot'

Here's the configuration of the rootpath/path settings:
$mcImageManagerConfig['filesystem.rootpath'] = '../../../../default/files';
$mcImageManagerConfig['filesystem.path'] = '../../../../default/files';

Hope this helps clarify things further!

Thanks for the support once again!

Last edited by myplanetdigital (2012-02-07 18:29:51)

4

Re: Image not loading when trying to edit / crop it.

You could enable debug logging to see what it outputs then. Set log.level=debug and log.level=true then check the debug logs in imagemanager/logs. Send me the log details there and I could tell you what to set as the root.

Best regards,
Spocke - Main developer of TinyMCE

5

Re: Image not loading when trying to edit / crop it.

Hey there Spocke!

I did a bunch of tracing and finally found that the problem was that the $mcFileManagerConfig['preview.wwwroot'] was in fact what was causing the problem.

Our test server is hosted by Acquia and the way they've setup the server has a bunch of symlinks that point to the correct path. I found out that the path I *thought* was the root path was in fact not by doing a var_dump() in the convertPathToURI() function in MCImageManager\classes\ManagerEngine.php.

Thanks very much for your help! I just finished finding the cause of the problem and fixing it and I see that simply enabling the logging system would probably have shown me the cause a lot quicker. I will keep it in mind down the line.

Once again, thank you very much! Please consider this case solved smile

Last edited by myplanetdigital (2012-02-07 22:21:38)

6

Re: Image not loading when trying to edit / crop it.

Nice to hear that it was resolved.

Best regards,
Spocke - Main developer of TinyMCE