Answer the question
In order to leave comments, you need to log in
Why doesn't CIBlockElement::SetPropertyValuesEx work?
I use the following code, but it does not work in any way, although it is written according to the manual:
$ELEMENT_ID = $_GET["id"];
$PROPERTY_CODE = "LIKES";
CIBlockElement::SetPropertyValuesEx($ELEMENT_ID, false, array($PROPERTY_CODE => 5));
Answer the question
In order to leave comments, you need to log in
Five options:
1. Wrong ELEMENT_ID in the GET parameter.
2. The property with the code "LIKES" exists in another infoblock, and you need to specify IBLOCK_ID in the method.
3. The "LIKES" property is plural and is assigned a single value.
4. Property "LIKES" does not exist.
5. The "iblock" module is not connected:CModule::IncludeModule('iblock');
Possibly incorrect $_GET["id"].
Better not make a direct request from $_GET, but handle $ELEMENT_ID = filter_input(INPUT_GET, 'id'); to avoid any surprises.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question