Tags sorted by name not ID, fixes #522

- Affected views: Tag index, event view tag attach dropdown
pull/541/head
Iglocska 2015-06-05 15:34:21 +02:00
parent 2b0a1e5c4e
commit 49e605db6d
2 changed files with 3 additions and 3 deletions

View File

@ -796,7 +796,7 @@ class EventsController extends AppController {
'fields' => array('Tag.id', 'Tag.colour', 'Tag.name'),
));
$this->set('tags', $tags);
$tags = $this->Event->EventTag->Tag->find('all', array('recursive' => -1));
$tags = $this->Event->EventTag->Tag->find('all', array('recursive' => -1, 'order' => array('Tag.name ASC')));
$tagNames = array('None');
foreach ($tags as $k => $v) {
$tagNames[$v['Tag']['id']] = $v['Tag']['name'];

View File

@ -14,7 +14,7 @@ class TagsController extends AppController {
public $paginate = array(
'limit' => 50,
'order' => array(
'Tag.id' => 'desc'
'Tag.name' => 'asc'
)
);
@ -120,7 +120,7 @@ class TagsController extends AppController {
'fields' => array('Tag.id', 'Tag.colour', 'Tag.name'),
));
$this->set('tags', $tags);
$tags = $this->Tag->find('all', array('recursive' => -1));
$tags = $this->Tag->find('all', array('recursive' => -1, 'order' => array('Tag.name ASC')));
$tagNames = array('None');
foreach ($tags as $k => $v) {
$tagNames[$v['Tag']['id']] = $v['Tag']['name'];