Skip to content

Commit

Permalink
FIX #3726 Not showing images on product card
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarcet committed Oct 29, 2015
1 parent 1eca2d3 commit 62dc681
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions htdocs/product/document.php
Expand Up @@ -70,8 +70,10 @@
{
$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';

Expand Down

0 comments on commit 62dc681

Please sign in to comment.