fix: Fix to an error with MISP and MySQL 5.7+ caused by no order clause on a distinct select query, fixes #1188

pull/1194/head
Iglocska 2016-05-29 22:36:07 +02:00
parent be7b534a9e
commit e92268229d
1 changed files with 2 additions and 1 deletions

View File

@ -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'];
}