Fix edit of categories

This commit is contained in:
Laurent Destailleur 2017-09-18 01:39:39 +02:00
parent 3f7b705674
commit 291a0d46e6
6 changed files with 12 additions and 12 deletions

View File

@ -145,7 +145,7 @@ if ($action == 'add')
if ($id > 0)
{
// Category association
$categories = GETPOST('categories');
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
$_GET["id"]=$id; // Force chargement page en mode visu
@ -239,7 +239,7 @@ if ($action == 'update')
if ($result >= 0)
{
// Category association
$categories = GETPOST('categories');
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
$_GET["id"]=$_POST["id"]; // Force chargement page en mode visu

View File

@ -224,7 +224,7 @@ if (empty($reshook))
$action = 'create';
} else {
// Categories association
$contcats = GETPOST( 'contcats', 'array' );
$contcats = GETPOST( 'contcats', 'array');
$object->setCategories($contcats);
}
}
@ -383,7 +383,7 @@ if (empty($reshook))
$db->query( $sql );
// Then we add the associated categories
$categories = GETPOST( 'contcats', 'array' );
$categories = GETPOST( 'contcats', 'array');
$object->setCategories($categories);
$object->old_lastname='';

View File

@ -340,7 +340,7 @@ if (empty($reshook))
if ($id > 0)
{
// Category association
$categories = GETPOST('categories');
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
@ -444,7 +444,7 @@ if (empty($reshook))
if ($object->update($object->id, $user) > 0)
{
// Category association
$categories = GETPOST('categories');
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
$action = 'view';

View File

@ -187,7 +187,7 @@ if (empty($reshook))
if (! $error && !empty($object->id) > 0)
{
// Category association
$categories = GETPOST('categories');
$categories = GETPOST('categories', 'array');
$result=$object->setCategories($categories);
if ($result<0) {
$langs->load("errors");
@ -282,7 +282,7 @@ if (empty($reshook))
else setEventMessages($object->error, $object->errors, 'errors');
}else {
// Category association
$categories = GETPOST('categories');
$categories = GETPOST('categories', 'array');
$result=$object->setCategories($categories);
if ($result < 0)
{

View File

@ -490,7 +490,7 @@ if (empty($reshook))
}
// Customer categories association
$custcats = GETPOST( 'custcats', 'array' );
$custcats = GETPOST('custcats', 'array');
$object->setCategories($custcats, 'customer');
// Supplier categories association
@ -607,7 +607,7 @@ if (empty($reshook))
}
// Customer categories association
$categories = GETPOST( 'custcats', 'array' );
$categories = GETPOST('custcats', 'array');
$object->setCategories($categories, 'customer');
// Supplier categories association

View File

@ -260,7 +260,7 @@ if (empty($reshook)) {
}
if (! empty($conf->categorie->enabled)) {
// Categories association
$usercats = GETPOST( 'usercats', 'array' );
$usercats = GETPOST('usercats', 'array');
$object->setCategories($usercats);
}
$db->commit();
@ -478,7 +478,7 @@ if (empty($reshook)) {
if (! $error && ! count($object->errors))
{
// Then we add the associated categories
$categories = GETPOST( 'usercats', 'array' );
$categories = GETPOST('usercats', 'array');
$object->setCategories($categories);
}