Answer the question
In order to leave comments, you need to log in
How to check before deleting an element from an infoblock?
OnBeforeIBlockElementDeleteHandler is not executed at all. https://dev.1c-bitrix.ru/api_help/iblock/events/on... used this event. But the ID does not come at all. Is it possible to get it via var_dump?
Answer the question
In order to leave comments, you need to log in
AddEventHandler("iblock", "OnBeforeIBlockElementDelete", Array("MyClass", "OnBeforeIBlockElementDeleteHandler"));
class MyClass
{
function OnBeforeIBlockElementDeleteHandler($ID)
{
$res = CIBlockElement::GetByID($ID);
if($arItem = $res->GetNext()){
\Bitrix\Main\Diag\Debug::dumpToFile($arItem, 'arItem');
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question