Skip to content

Commit

Permalink
Merge pull request #73 from oc-shopaholic/develop
Browse files Browse the repository at this point in the history
Release version 1.25.2
  • Loading branch information
kharanenka authored May 31, 2019
2 parents 1851e27 + dc0e435 commit 87f8a6b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
22 changes: 15 additions & 7 deletions classes/helper/AbstractImportModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,16 @@ protected function importImageList()

//Check image
if (!empty($sFilePath) && (!file_exists($obImage->getLocalPath()) || md5_file($sFilePath) != md5_file($obImage->getLocalPath()))) {
$obImage->deleteThumbs();
try {
$obImage->deleteThumbs();
} catch (\Exception $obException) {}
$obImage->fromFile($sFilePath);
$obImage->save();
} elseif (empty($sFilePath)) {
$obImage->deleteThumbs();
$obImage->delete();
try {
$obImage->deleteThumbs();
$obImage->delete();
} catch (\Exception $obException) {}
}
}
}
Expand Down Expand Up @@ -279,8 +283,10 @@ protected function importPreviewImage()
$obPreviewImage->fromFile($this->sPreviewImage);
$obPreviewImage->save();
} elseif (!empty($obPreviewImage) && empty($this->sPreviewImage)) {
$obPreviewImage->deleteThumbs();
$obPreviewImage->delete();
try {
$obPreviewImage->deleteThumbs();
$obPreviewImage->delete();
} catch (\Exception $obException) {}
}
}

Expand All @@ -297,8 +303,10 @@ protected function removeAllImages()

/** @var \System\Models\File $obFile */
foreach ($obImageList as $obFile) {
$obFile->deleteThumbs();
$obFile->delete();
try {
$obFile->deleteThumbs();
$obFile->delete();
} catch (\Exception $obException) {}
}
}

Expand Down
4 changes: 3 additions & 1 deletion updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@
1.25.0:
- 'Added classes for import elements from xml file.'
1.25.1:
- 'Fixed openMainFile method in AbstractImportModelFromXML class.'
- 'Fixed openMainFile method in AbstractImportModelFromXML class.'
1.25.2:
- 'Added try->catch section for removing images in AbstractImportModel class.'

0 comments on commit 87f8a6b

Please sign in to comment.