Answer the question
In order to leave comments, you need to log in
Strange behavior of getlist. Where is the mistake?
Hello!
Entangled in three pines. For some reason, the following code outputs each element twice:
$resElements = CIBlockElement::GetList(
Array("SORT"=>"ASC"),
Array("IBLOCK_ID"=>2,"SECTION_ID"=>$arSection["ID"],/*"INCLUDE_SUBSECTIONS" => "Y", "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y" */),
false,
false,
Array("ID", "IBLOCK_ID", "NAME", 'PROPERTY_'.$NAME_PROPERTY_SNAP)
);
if($resElements) { ?>
<ul class="isvapp_iblock_helper__sub-menu">
<? while($obElements = $resElements->GetNext()) {
?>
<li><div class="isvapp_iblock_helper__menu_title">
<input type="checkbox" name="ELEMENT_ID[]" class="element-checkbox" value="<?=$obElements["ID"];?>"<?=$checked;?>>
<span class="isvapp_iblock_helper__menu_title-text"><?=$obElements["NAME"];?></span>
</div>
</li>
<? } ?>
</ul>
<? } ?>
Answer the question
In order to leave comments, you need to log in
Possibly due to the fact that a multiple property is involved in the selection ('PROPERTY_'.$NAME_PROPERTY_SNAP)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question