Skip to content

Commit 1863ce6

Browse files
trabuliumcolinmollenhour
authored andcommitted
Fixes issue with wysiwyg editor re-creating thumbnails (OpenMage#261)
* Fixes issue with wysiwyg editor re-creating thumbnails each load causing performance / database connection limit issues.
1 parent 43e975f commit 1863ce6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,13 @@ public function getThumbnailPath($filePath, $checkFile = false)
339339
*/
340340
public function getThumbnailUrl($filePath, $checkFile = false)
341341
{
342-
$mediaRootDir = $this->getHelper()->getStorageRoot();
342+
$mediaRootDir = Mage::getConfig()->getOptions()->getMediaDir() . DS;
343343

344344
if (strpos($filePath, $mediaRootDir) === 0) {
345345
$thumbSuffix = self::THUMBS_DIRECTORY_NAME . DS . Mage_Cms_Model_Wysiwyg_Config::IMAGE_DIRECTORY
346346
. DS . substr($filePath, strlen($mediaRootDir));
347347

348-
if (! $checkFile || is_readable($mediaRootDir . $thumbSuffix)) {
348+
if (! $checkFile || is_readable($this->getHelper()->getStorageRoot() . $thumbSuffix)) {
349349
$randomIndex = '?rand=' . time();
350350
$thumbUrl = $this->getHelper()->getBaseUrl() . Mage_Cms_Model_Wysiwyg_Config::IMAGE_DIRECTORY
351351
. DS . $thumbSuffix;

0 commit comments

Comments
 (0)