diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index d7eaada15c3..321e7a0e577 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -248,7 +248,9 @@ class Conf
$this->fournisseur->commande->dir_temp =$rootfordata."/fournisseur/commande/temp";
$this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture";
$this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp";
- // Module service
+ // Module product/service
+ $this->product->dir_output=$rootfordata."/produit";
+ $this->product->dir_temp =$rootfordata."/produit/temp";
$this->service->dir_output=$rootfordata."/produit";
$this->service->dir_temp =$rootfordata."/produit/temp";
// Module contrat
diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php
index 8a352b52211..fe1fdbce0da 100644
--- a/htdocs/core/photos_resize.php
+++ b/htdocs/core/photos_resize.php
@@ -46,6 +46,7 @@ if ($_POST["action"] == 'confirm_resize' && (isset($_POST["file"]) != "") && (is
{
$product=new Product($db);
$result=$product->fetch($_POST["id"]);
+ if ($result <= 0) dol_print_error($db,'Failed to load object');
$dir=$conf->product->dir_output; // By default
if ($product->type == 0) $dir=$conf->product->dir_output;
if ($product->type == 1) $dir=$conf->service->dir_output;
@@ -55,7 +56,7 @@ if ($_POST["action"] == 'confirm_resize' && (isset($_POST["file"]) != "") && (is
if ($result == $fullpath)
{
- header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["product"].'&action=addthumb&file='.urldecode($_POST["file"]));
+ header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["id"].'&action=addthumb&file='.urldecode($_POST["file"]));
exit;
}
else
@@ -71,6 +72,7 @@ if ($_POST["action"] == 'confirm_crop')
{
$product=new Product($db);
$result=$product->fetch($_POST["id"]);
+ if ($result <= 0) dol_print_error($db,'Failed to load object');
$dir=$conf->product->dir_output; // By default
if ($product->type == 0) $dir=$conf->product->dir_output;
if ($product->type == 1) $dir=$conf->service->dir_output;
@@ -80,7 +82,7 @@ if ($_POST["action"] == 'confirm_crop')
if ($result == $fullpath)
{
- header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["product"].'&action=addthumb&file='.urldecode($_POST["file"]));
+ header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["id"].'&action=addthumb&file='.urldecode($_POST["file"]));
exit;
}
else
@@ -123,8 +125,8 @@ print $langs->trans("NewLength").': trans("NewHeight").': px
';
print '';
print '';
-print '';
-print '';
+print '';
+print '';
print '
';
print '';
print '
';
@@ -157,8 +159,8 @@ print '