$getPerms = (array) \Civi\Api4\Permission::get(0)
->addWhere('group', 'IN', ['civicrm', 'cms', 'const'])
- ->setOrderBy(['group' => 'ASC', 'name' => 'ASC'])
+ ->setOrderBy(['title' => 'ASC'])
->execute();
$permissions = [];
foreach ($getPerms as $perm) {
$getPerms = \Civi\Api4\Permission::get(0)
->addWhere('is_active', '=', 1)
->addWhere('group', 'IN', ['civicrm', 'cms', 'const'])
- ->setOrderBy(['group' => 'ASC', 'name' => 'ASC'])
+ ->setOrderBy(['title' => 'ASC'])
->execute();
$form->addElement('select',
'permission',
$perms = \Civi\Api4\Permission::get()
->addWhere('group', 'IN', ['afformGeneric', 'const', 'civicrm', 'cms'])
->addWhere('is_active', '=', 1)
- ->setOrderBy(['group' => 'ASC', 'name' => 'ASC'])
+ ->setOrderBy(['title' => 'ASC'])
->execute();
foreach ($perms as $perm) {
$data['permissions'][] = [