Missing user
This commit is contained in:
parent
a7e0fdba49
commit
a833c271e1
@ -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)
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user