Merged in bugfix/PMCORE-2672 (pull request #7703)

PMCORE-2672 'Admin' option is duplicate in the list

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Roly Rudy Gutierrez Pinto
2021-01-06 19:21:31 +00:00
committed by Julio Cesar Laura Avendaño

View File

@@ -395,6 +395,18 @@ try {
break;
}
}
//remove duplicate elements
foreach ($rows as &$row) {
$row = json_encode($row);
}
$rows = array_unique($rows);
foreach ($rows as &$row) {
$row = json_decode($row);
}
//sort items by name for pretty view
usort($rows, function($a, $b) {
return $a->name > $b->name;
});
print(G::json_encode($rows));
break;
case 'defaultCasesMenuOptionList':