fix error when removing permission without scope from group

This commit is contained in:
2018-09-05 11:06:33 +02:00
parent e88265adcd
commit 0a0854d4cf
2 changed files with 10 additions and 1 deletions

View File

@@ -365,13 +365,20 @@ class PermissionsGroupController extends Controller
$em->flush();
$this->addFlash('notice',
if ($roleScope->getScope() !== NULL ) {
$this->addFlash('notice',
$this->get('translator')->trans("The role '%role%' on circle "
. "'%scope%' has been removed", array(
'%role%' => $this->get('translator')->trans($roleScope->getRole()),
'%scope%' => $this->get('chill.main.helper.translatable_string')
->localize($roleScope->getScope()->getName())
)));
} else {
$this->addFlash('notice',
$this->get('translator')->trans("The role '%role%' has been removed", array(
'%role%' => $this->get('translator')->trans($roleScope->getRole())
)));
}
return $this->redirect($this->generateUrl('admin_permissionsgroup_edit',
array('id' => $pgid)));