I can not change the properties of an inactive element. Using:

CModule::IncludeModule("iblock"); $el = new CIBlockElement; $arProps = Array("ACTIVE"=> "Y"); $res = $el->Update($ELEMENT_ID, $arProps); 

Nothing happens, even no errors. If I change my property this way:

 CIBlockElement::SetPropertyValuesEx($ELEMENT_ID, false, array($PROPERTY_CODE => '191')); 

also does not change, but it is necessary to make the element active, turning off the activity code above works, and changing user properties. The question is that I am doing something wrong or in principle the bitrix cannot change any properties of inactive elements? ps Please do not minus, give a comment that it is not clear, I will add a question

  • Just in case I will clarify, is the information block module connected at the beginning of the file? - Smolin Pavel
  • @SmolinPavel Yes Connected - Max Harper
  • one
    There is no interception event in init.php? - EatMyDust 1:54 pm

1 answer 1

try to find out what the error is, some handlers or required fields may interfere, add var_dump ($ res-> LAST_ERROR); In the end:

  CModule::IncludeModule("iblock"); $el = new CIBlockElement; $arProps = Array("ACTIVE"=> "Y"); $res = $el->Update($ELEMENT_ID, $arProps); var_dump($res->LAST_ERROR);