fix issue with empty cat

This commit is contained in:
Simon Vieille 2020-08-13 16:33:02 +02:00
parent d30603c7d1
commit c6a43f755d
3 changed files with 12 additions and 8 deletions

View file

@ -15,7 +15,7 @@ You can report a bug or request a feature by opening an issue.
]]></description>
<licence>agpl</licence>
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
<version>1.8.0-rc1</version>
<version>1.8.0-rc2</version>
<namespace>SideMenu</namespace>
<category>customization</category>
<website>https://gitnet.fr/deblan/side_menu</website>

View file

@ -188,8 +188,12 @@ class NavController extends Controller
}
foreach ($items as $category => $value) {
if (empty($items[$category]['apps'])) {
unset($items[$category]);
} else {
ksort($items[$category]['apps']);
}
}
usort($items, function ($a, $b) {
return ($a['name'] < $b['name']) ? -1 : 1;