Commit e9fc2abf authored by Oleksandr Horbatiuk's avatar Oleksandr Horbatiuk 🧩 Committed by Oleksandr Horbatiuk
Browse files

Issue #3256927 by chmez: Use a new hook for detecting which group types...

Issue #3256927 by chmez: Use a new hook for detecting which group types support the request join method
parent 285d1ce2
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -8,10 +8,17 @@
use Drupal\Core\Form\FormStateInterface;

/**
 * Implements hook_social_group_request_alter().
 * Implements hook_social_group_join_method_usage().
 */
function social_course_advanced_request_social_group_request_alter(array &$group_types): void {
  $group_types[] = 'course_advanced';
function social_course_advanced_request_social_group_join_method_usage(): array {
  return [
    [
      'entity_type_id' => 'group',
      'bundle' => 'course_advanced',
      'field' => 'allow_request',
      'method' => 'request',
    ],
  ];
}

/**
+10 −3
Original line number Diff line number Diff line
@@ -8,10 +8,17 @@
use Drupal\Core\Form\FormStateInterface;

/**
 * Implements hook_social_group_request_alter().
 * Implements hook_social_group_join_method_usage().
 */
function social_course_basic_request_social_group_request_alter(array &$group_types): void {
  $group_types[] = 'course_basic';
function social_course_basic_request_social_group_join_method_usage(): array {
  return [
    [
      'entity_type_id' => 'group',
      'bundle' => 'course_basic',
      'field' => 'allow_request',
      'method' => 'request',
    ],
  ];
}

/**