Create function requires $group_relationship->save()

Created on 5 September 2024, 2 months ago
Updated 6 September 2024, 2 months ago

Hi, Thanks for creating the module + readme.

After a while of trying to add a request programmatically...

$request_manager = \Drupal::service('grequest.membership_request_manager');
$request_manager->create($group, $user);

I discovered groups weren't being created and found that the create function doesn't actually save the group_relationship, it's just creates it ready to save.

I wanted to suggest adding "$group_relationship->save()" to the bottom of the function. But if that doesn't work for the way it's been implemented, it would be nice to add that to the readme.

Thank you.

Jeremy.

📌 Task
Status

Active

Version

3.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jez300
  • 🇧🇪Belgium lobsterr

    This was done intentionally, because in some cases we need not saved group_content (group_relationship) object.
    What we can add a parameter to the method, which will allow also save the group_content (group_relationship) entity

Production build 0.71.5 2024