V
V
Vasya2018-05-26 14:16:41
1C-Bitrix
Vasya, 2018-05-26 14:16:41

How to get custom forum message field CForumMessage::GetListEx?

Property created
5b094194e2efd541992613.pngWhy doesn't the function return it?

  • There are no corresponding keys in print_r
  • have not yet filled out the forum messages

Returns a list of messages (including related data) ....

$res = CForumMessage::GetListEx(array("POST_DATE"=>"DESC"), array('@TOPIC_ID'=>$arTopicIds), false, false, ["ID", "UF_ADMIN_ANSWER"]);
while($arMessages = $res->Fetch())
{
     // ... смотрим дамп
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasya, 2018-05-27
@haramba

As the analysis of the Bitrix code showed, contrary to the documentation (or the ambiguity of what was written), user fields are selected by the CForumMessage::GetList function, and not GetListEx

$res = CForumMessage::GetList(array("POST_DATE"=>"DESC"), array("@TOPIC_ID" => [540, 557], ), false, 0, [ "SELECT" => ["UF_ADMIN_ANSWER"]]);
  while($arMessages = $res->Fetch())
  {
    var_dump($arMessages);
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question