Answer the question
In order to leave comments, you need to log in
Why doesn't \Bitrix\Iblock\ElementTable::update work?
\Bitrix\Iblock\ElementTable::update(
$arData['PRODUCT_ID'],
[
'MODIFIED_BY' => COption::GetOptionString(self::MODULE_ID, 'AGENT_OPTIONS_USER_MODIFY'),
'TIMESTAMP_X' => $arData['TIMESTAMP_X']
]
);
Для изменения элементов инфоблоков используйте вызов CIBlockElement::Update()
\Bitrix\Main\Entity\UpdateResult public static
\Bitrix\Iblock\ElementTable::update(
mixed $primary,
array $data
);
Answer the question
In order to leave comments, you need to log in
Removed the ability to use add/remove/update operations for IS elements (table \Bitrix\Iblock\ElementTable) through the D7 kernel in the kernel. When updating an IB element, you need to change quite a lot of data in other tables (search indexes, facets, etc.). Therefore, in the bitrix/modules/iblock/lib/element.php code, you can see the following:
public static function add(array $data)
{
$result = new ORM\Data\AddResult();
$result->addError(new ORM\EntityError(
Loc::getMessage('ELEMENT_ENTITY_MESS_ADD_BLOCKED')
));
return $result;
}
public static function update($primary, array $data)
{
$result = new ORM\Data\UpdateResult();
$result->addError(new ORM\EntityError(
Loc::getMessage('ELEMENT_ENTITY_MESS_UPDATE_BLOCKED')
));
return $result;
}
public static function delete($primary)
{
$result = new ORM\Data\DeleteResult();
$result->addError(new ORM\EntityError(
Loc::getMessage('ELEMENT_ENTITY_MESS_DELETE_BLOCKED')
));
return $result;
}
The method is disabled. Use the CIBlockElement::Update method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question