Skip to content

Instantly share code, notes, and snippets.

View flummingbird's full-sized avatar

Will flummingbird

  • Hudson Valley
View GitHub Profile
@elizoller
elizoller / groups.php
Last active April 3, 2023 15:03
Group module usage. I'm sure this isn't all applicable to everyone. But basically its designed to create a group for a collection when one is created. When an item is created or updated, it should update the group it belongs to.
<?php
use Drupal\group\Entity\Group;
/**
* Implements hook_node_insert().
*
* Alternatively could trigger this with a context reaction.
*/
function asu_permissions_node_insert(NodeInterface $node) {