Commit 6fb2b65c authored by Dale McGladdery's avatar Dale McGladdery Committed by renatog
Browse files

Issue #2997257 by dale42, Vj, RenatoG, Dinesh18, saphemmy, dwkitchen: Invite...

Issue #2997257 by dale42, Vj, RenatoG, Dinesh18, saphemmy, dwkitchen: Invite type page available even when no sub-modules of invite type installed
parent 575e6389
Loading
Loading
Loading
Loading
+12 −2
Changes for src/Form/InviteTypeForm.php: 12 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -152,17 +152,27 @@ class InviteTypeForm extends EntityForm {
      ];
    }
    else {
      $this->messenger->addWarning($this->t('Please enable a sending method module such as Invite by email.'));
      $form['send_method'] = [
        '#type' => 'item',
        '#markup' => $this->t('Please enable a sending method module such as Invite by email.'),
      ];
      $form['actions']['submit']['#disabled'] = TRUE;

    }

    return $form;
  }

  /**
   * {@inheritdoc}
   */
  protected function actions(array $form, FormStateInterface $form_state) {
    $actions = parent::actions($form, $form_state);
    if (empty($this->pluginManager->getDefinitions())) {
      $actions['submit']['#disabled'] = TRUE;
    }
    return $actions;
  }

  /**
   * Helper method to add an invite_sender record.
   */