mirror of https://github.com/MISP/MISP
Merge branch '2.4' of github.com:MISP/MISP into 2.4
commit
9975e9e437
|
@ -747,11 +747,10 @@ class MispObject extends AppModel
|
|||
}
|
||||
$attribute_types = array_keys($attribute_types);
|
||||
|
||||
$potential_templates = $this->ObjectTemplate->find('all', array(
|
||||
$potential_templates = $this->ObjectTemplate->find('list', array(
|
||||
'recursive' => -1,
|
||||
'fields' => array(
|
||||
'ObjectTemplate.id',
|
||||
'ObjectTemplate.name',
|
||||
'COUNT(ObjectTemplateElement.type) as type_count'
|
||||
),
|
||||
'conditions' => array(
|
||||
|
@ -767,11 +766,11 @@ class MispObject extends AppModel
|
|||
'conditions' => array('ObjectTemplate.id = ObjectTemplateElement.object_template_id')
|
||||
)
|
||||
),
|
||||
'group' => 'ObjectTemplate.name',
|
||||
'group' => 'ObjectTemplate.id',
|
||||
'order' => 'type_count DESC'
|
||||
));
|
||||
|
||||
$potential_template_ids = Hash::extract($potential_templates, '{n}.ObjectTemplate.id');
|
||||
$potential_template_ids = array_keys($potential_templates);
|
||||
$templates = $this->ObjectTemplate->find('all', array(
|
||||
'recursive' => -1,
|
||||
'conditions' => array('id' => $potential_template_ids),
|
||||
|
|
Loading…
Reference in New Issue