Skip to content

Commit

Permalink
[perf-OpenMage#261] Wysiwyg editor always re-creates thumbnails
Browse files Browse the repository at this point in the history
Fixes issue with wysiwyg editor always re-creating thumbnails,
causing performance / database connection limit issues.
  • Loading branch information
trabulium authored and edannenberg committed Aug 22, 2019
1 parent 33c8817 commit b20cbce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ public function getThumbnailPath($filePath, $checkFile = false)
*/
public function getThumbnailUrl($filePath, $checkFile = false)
{
$mediaRootDir = $this->getHelper()->getStorageRoot();
$mediaRootDir = Mage::getConfig()->getOptions()->getMediaDir() . DS;

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

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

0 comments on commit b20cbce

Please sign in to comment.