mirror of https://github.com/MISP/MISP
fix: Fix to an error with MISP and MySQL 5.7+ caused by no order clause on a distinct select query, fixes #1188
parent
be7b534a9e
commit
e92268229d
|
@ -24,7 +24,8 @@ class TemplateElement extends AppModel {
|
|||
public function lastPosition($template_id) {
|
||||
$result = $this->find('first', array(
|
||||
'fields' => array('MAX(position) AS pos', 'id', 'template_id'),
|
||||
'conditions' => array('template_id' => $template_id)
|
||||
'conditions' => array('template_id' => $template_id),
|
||||
'order' => array('id')
|
||||
));
|
||||
return $result[0]['pos'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue