Fix revision proposed text in forums BT#15173

pull/2858/head
Julio Montoya 7 years ago
parent abeb752448
commit fa99373d86
  1. 1
      main/forum/reply.php
  2. 24
      main/inc/lib/extra_field_value.lib.php

@ -158,7 +158,6 @@ $logInfo = [
'tool_id' => $forumId,
'tool_id_detail' => $threadId,
'action' => !empty($my_action) ? $my_action : 'reply',
'action_details' => '',
];
Event::registerLog($logInfo);

@ -5,7 +5,6 @@ use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField;
use Chamilo\CoreBundle\Entity\ExtraFieldRelTag;
use Chamilo\CoreBundle\Entity\ExtraFieldValues;
use Chamilo\CoreBundle\Entity\Tag;
use ChamiloSession as Session;
/**
* Class ExtraFieldValue
@ -81,12 +80,19 @@ class ExtraFieldValue extends Model
* @param array $params array for the insertion into the *_field_values table
* @param bool $onlySubmittedFields Only save parameters in the $param array
* @param bool $showQuery
* @param array $saveOnlyThisFields
* @param array $avoidFields do not insert/modify this field
*
* @return mixed false on empty params, void otherwise
* @assert (array()) === false
*/
public function saveFieldValues($params, $onlySubmittedFields = false, $showQuery = false)
{
public function saveFieldValues(
$params,
$onlySubmittedFields = false,
$showQuery = false,
$saveOnlyThisFields = [],
$avoidFields = []
) {
foreach ($params as $key => $value) {
$found = strpos($key, '__persist__');
@ -128,6 +134,18 @@ class ExtraFieldValue extends Model
continue;
}
if (!empty($avoidFields)) {
if (in_array($field_variable, $avoidFields)) {
continue;
}
}
if (!empty($saveOnlyThisFields)) {
if (!in_array($field_variable, $saveOnlyThisFields)) {
continue;
}
}
$value = '';
if (isset($params['extra_'.$field_variable])) {
$value = $params['extra_'.$field_variable];

Loading…
Cancel
Save