- Issue created by @introfini
- Status changed to Closed: works as designed
12 months ago 7:58pm 26 December 2023 - 🇵🇹Portugal introfini
I figured out why it wasn't working: the problem was that my admin account didn't have the Administrator role set.
I'm attempting to programmatically create groups in version 3. Despite their successful creation, none are listed in the /admin/group section.
Here's the code I'm using:
$node = Node::load($nid);
$group = Group::create([
'type' => 'client',
'label' => $node->getTitle(),
]);
$user = User::load(1);
$group->setOwner($user);
$group->save();
Am I missing something obvious?
Closed: works as designed
3.2
Code
I figured out why it wasn't working: the problem was that my admin account didn't have the Administrator role set.