// Fixed image import

This commit is contained in:
Dragan Skrbic committed 2013-04-29 18:07:42 +02:00
1 parent 7eba77ae66
commit 7f8a33763a
2 files changed
+2 -4

No files matched your search

+1 -1
View File
@@ -1332,7 +1332,7 @@ class ToolsCore
$opts = stream_context_get_options($stream_context); $opts = stream_context_get_options($stream_context);
$content = curl_exec($curl); $content = curl_exec($curl);
curl_close($curl); curl_close($curl);
return file_put_contents($content, $destination); return file_put_contents($destination, $content);
} }
else else
return false; return false;
+1 -3
View File
@@ -1433,9 +1433,7 @@ class AdminImportControllerCore extends AdminController
$image->position = Image::getHighestPosition($product->id) + 1; $image->position = Image::getHighestPosition($product->id) + 1;
$image->cover = (!$key && !$product_has_images) ? true : false; $image->cover = (!$key && !$product_has_images) ? true : false;
// file_exists doesn't work with HTTP protocol // file_exists doesn't work with HTTP protocol
if (@fopen($url, 'r') == false) if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true &&
$error = true;
else if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true &&
($lang_field_error = $image->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true && $image->add()) ($lang_field_error = $image->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true && $image->add())
{ {
// associate image to selected shops // associate image to selected shops