- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/rest/controllers/task.php
- Класс: Bitrix\Tasks\Rest\Controllers\Task
- Вызов: Task::updateAction
public function updateAction(\CTaskItem $task, array $fields, array $params = []): ?array { $fields = $this->filterFields($fields); $fields = $this->formatDateFieldsForInput($fields, $params); $fields = $this->processFiles($task->getId(), $fields); $fields = $this->processCrmElements($fields); try { //todo: tmp, remove after internalizer is injected $fields = $this->removeReferences($fields); $task->update($fields, $params); } catch (\Exception $exception) { if ($errors = unserialize($exception->getMessage(), ['allowed_classes' => false])) { $error = $errors[0]; $this->addError(new Error($error['text'], $error['id'])); } else { $this->addError(new Error($exception->getMessage())); } return null; } if (Loader::includeModule('pull')) { MobileCounter::send($this->getCurrentUser()->getId()); } return $this->getAction($task); }