Fix update legal terms - refs BT#11360

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 997719b4e3
commit 2c14b74acd
  1. 11
      main/inc/lib/legal.lib.php

@ -31,6 +31,14 @@ class LegalManager
$time = time();
if ($last['content'] != $content) {
$maxLegalId = Database::getManager()
->createQuery('
SELECT MAX(l.legalId) FROM ChamiloCoreBundle:Legal l
')
->getSingleScalarResult();
$legalId = $maxLegalId + 1;
$version = intval(LegalManager::get_last_condition_version($language));
$version++;
$params = [
@ -39,7 +47,8 @@ class LegalManager
'changes' => $changes,
'type' => $type,
'version' => intval($version),
'date' => $time
'date' => $time,
'legal_id' => $legalId
];
Database::insert($legal_table, $params);

Loading…
Cancel
Save