Missing user

This commit is contained in:
Laurent Destailleur 2018-03-10 12:37:44 +01:00
parent a7e0fdba49
commit a833c271e1
2 changed files with 5 additions and 4 deletions

View File

@ -140,15 +140,16 @@ class ProductAttributeValue
/**
* Creates a value for a product attribute
*
* @return int <0 KO >0 OK
* @param User $user Object user
* @return int <0 KO >0 OK
*/
public function create()
public function create(User $user)
{
if (!$this->fk_product_attribute) {
return -1;
}
//Ref must be uppercase
// Ref must be uppercase
$this->ref = strtoupper($this->ref);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_attribute_value (fk_product_attribute, ref, value, entity)

View File

@ -65,7 +65,7 @@ if ($action == 'add')
$objectval->ref = $ref;
$objectval->value = $value;
if ($objectval->create() > 0) {
if ($objectval->create($user) > 0) {
setEventMessage($langs->trans('RecordSaved'));
header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$object->id);
exit();