Skip to content
Snippets Groups Projects

The OG role 'og_role' entity should not extend core's 'role'

Merged Joël Pittet requested to merge issue/og-3484695:3484695-the-og-role into 2.x
Compare and
23 files
+ 414
418
Compare changes
  • Side-by-side
  • Inline
Files
23
@@ -11,9 +11,9 @@ use Drupal\Core\Form\FormStateInterface;
use Drupal\og\GroupPermission;
use Drupal\og\GroupTypeManager;
use Drupal\og\Og;
use Drupal\og\OgRoleInterface;
use Drupal\og\OgRoleManagerInterface;
use Drupal\og\PermissionManagerInterface;
use Drupal\user\RoleInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -55,9 +55,9 @@ class OgPermissionsForm extends FormBase {
/**
* The group roles.
*
* @var \Drupal\og\OgRoleInterface[]|\Drupal\user\RoleInterface[]
* @var \Drupal\og\OgRoleInterface[]
*/
protected $roles;
protected array $roles;
/**
* Constructs a new OgPermissionsForm.
@@ -172,14 +172,14 @@ class OgPermissionsForm extends FormBase {
$roles = $this->getGroupRoles($entity_type_id, $bundle_id);
uasort($roles, function (RoleInterface $a, RoleInterface $b) {
uasort($roles, function (OgRoleInterface $a, OgRoleInterface $b) {
if ($a->getWeight() == $b->getWeight()) {
return 0;
}
return ($a->getWeight() < $b->getWeight()) ? -1 : 1;
});
/** @var \Drupal\og\Entity\OgRole $role */
/** @var \Drupal\og\OgRoleInterface $role */
foreach ($roles as $role) {
$form['permissions']['#header'][] = [
'data' => $role->getLabel(),
Loading