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