Skip to content
Snippets Groups Projects
Commit 62dc6814 authored by fmarcet's avatar fmarcet
Browse files

FIX #3726 Not showing images on product card

parent 1eca2d33
No related branches found
No related tags found
No related merge requests found
......@@ -3764,7 +3764,7 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
// TODO if object is null, load it from id and modulepart.
if (! empty($level) && in_array($modulepart, array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier')))
if (! empty($level) && in_array($modulepart, array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier','product')))
{
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided
if (empty($alpha)) $num = preg_replace('/([^0-9])/i','',$num);
......
......@@ -70,8 +70,10 @@ if ($id > 0 || ! empty($ref))
{
$result = $object->fetch($id, $ref);
if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/';
elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/';
if($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)$upload_dir.= get_exdir($object->id,2,0,0,$object,'product').$object->id."/photos";
else $upload_dir.= dol_sanitizeFileName($object->ref);
}
$modulepart='produit';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment