Skip to content

Commit

Permalink
Merge pull request #15 from GiritInteractive/CLOUDINARY-9
Browse files Browse the repository at this point in the history
CLOUDINARY-9
  • Loading branch information
Pini authored Dec 19, 2018
2 parents e8dd7ae + f3470eb commit e92519b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ public function configSave(Varien_Event_Observer $observer)
public function cloudinaryConfigChanged(Varien_Event_Observer $observer)
{
//Clear config cache before mapping
Mage::getModel('cloudinary_cloudinary/autoUploadMapping_configuration')->setState(Configuration::INACTIVE);
Mage::app()->getCacheInstance()->cleanType("config");
Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => "config"));

if (!Mage::getModel('cloudinary_cloudinary/configuration')->isEnabled()) {
return;
}

if (!$this->autoUploadRequestProcessor()->handle('media', Mage::getBaseUrl('media'))) {
if (!$this->autoUploadRequestProcessor()->handle('media', Mage::getBaseUrl('media'), true)) {
Mage::getSingleton('adminhtml/session')->addError(self::AUTO_UPLOAD_SETUP_FAIL_MESSAGE);
Mage::getModel('cloudinary_cloudinary/logger')->error(self::AUTO_UPLOAD_SETUP_FAIL_MESSAGE);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ public function __construct(
/**
* @param string $folder
* @param string $url
* @param bool $force
* @return bool
*/
public function handle($folder, $url)
public function handle($folder, $url, $force = false)
{
if ($this->configuration->isActive() == $this->configuration->getRequestState()) {
if ($this->configuration->isActive() == $this->configuration->getRequestState() && !$force) {
return true;
}

Expand Down

0 comments on commit e92519b

Please sign in to comment.