Magento 1.8.1.0 WYSIWYG Editor Not Displaying Thumbnails – Fix

ce-1.8.1.0imagemagento-1.8thumbnailwysiwyg

I am posting this for comments about the bug, and to help anyone who have the same issue. (answer posted by myself)

When using the WYSIWYG editor and inserting images the image manager is not displaying the thumbnail images.

Looking at the image URL produced by magento I can see that the url is missing the /wysiwyg/ portion

http://site.domain/media//.thumbs/ex_logo_sm.jpg?rand=1392103618

It looks purely missing, as taken note by the double // in the url

Best Answer

Tracing the code, it looks to me that there is a constant missing in the helper routine located in Mage_Cms_Helper_Wysiwyg_Images::getBaseUrl()

The routine is as such:

public function getBaseUrl()
    {
        return Mage::getBaseUrl('media') . '/';
    }

and making the change to

public function getBaseUrl()
    {
        return Mage::getBaseUrl('media') . Mage_Cms_Model_Wysiwyg_Config::IMAGE_DIRECTORY . '/';
    }

fixes the issue.

This is called from Mage_Cms_Model_Wysiwyg_Images_Storage::getThumbnailUrl()

return str_replace('\\', '/', $this->getHelper()->getBaseUrl() . $thumbSuffix) . $randomIndex;

which clearly outputs the wrong url without the constant in place.

Related Topic