From: Kevin Levie Date: Wed, 22 Jul 2015 18:24:03 +0000 (+0200) Subject: Fix CRM-16866 for 4.6 branch X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2666861cb9f766ff333afe8ff441b4fe218dc6e7;p=civicrm-core.git Fix CRM-16866 for 4.6 branch --- diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 238c8ae5be..9d983b921f 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -605,16 +605,19 @@ class CRM_Core_Permission { $perm = $comp->getPermissions(FALSE, $descriptions); if ($perm) { $info = $comp->getInfo(); - if ($descriptions) { - foreach ($perm as $p => $attr) { - $title = $info['translatedName'] . ': ' . array_shift($attr); - array_unshift($attr, $title); + foreach ($perm as $p => $attr) { + + if (!is_array($attr)) { + $attr = array($attr); + } + + $attr[0] = $info['translatedName'] . ': ' . $attr[0]; + + if ($descriptions) { $permissions[$p] = $attr; } - } - else { - foreach ($perm as $p) { - $permissions[$p] = $info['translatedName'] . ': ' . $p; + else { + $permissions[$p] = $attr[0]; } } }