Loading src/Entity/Form/GroupMembershipRequestForm.php +2 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ use Drupal\Core\Form\ConfirmFormHelper; use Drupal\Core\Form\ConfirmFormInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\grequest\MembershipRequestManager; use Drupal\group\Plugin\Validation\Constraint\GroupContentCardinality; use Drupal\group\Plugin\Validation\Constraint\GroupRelationshipCardinality; use Symfony\Component\DependencyInjection\ContainerInterface; /** Loading Loading @@ -101,7 +101,7 @@ class GroupMembershipRequestForm extends ContentEntityForm implements ConfirmFor $violations = $this->entity->validate(); foreach ($violations as $violation) { $constraint = $violation->getConstraint(); if ($constraint instanceof GroupContentCardinality && $constraint->entityMessage == $violation->getMessage()->getUntranslatedString()) { if ($constraint instanceof GroupRelationshipCardinality && $constraint->entityMessage == $violation->getMessage()->getUntranslatedString()) { $form_state->setError($form, $this->t('You have already sent a request')); } } Loading Loading
src/Entity/Form/GroupMembershipRequestForm.php +2 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ use Drupal\Core\Form\ConfirmFormHelper; use Drupal\Core\Form\ConfirmFormInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\grequest\MembershipRequestManager; use Drupal\group\Plugin\Validation\Constraint\GroupContentCardinality; use Drupal\group\Plugin\Validation\Constraint\GroupRelationshipCardinality; use Symfony\Component\DependencyInjection\ContainerInterface; /** Loading Loading @@ -101,7 +101,7 @@ class GroupMembershipRequestForm extends ContentEntityForm implements ConfirmFor $violations = $this->entity->validate(); foreach ($violations as $violation) { $constraint = $violation->getConstraint(); if ($constraint instanceof GroupContentCardinality && $constraint->entityMessage == $violation->getMessage()->getUntranslatedString()) { if ($constraint instanceof GroupRelationshipCardinality && $constraint->entityMessage == $violation->getMessage()->getUntranslatedString()) { $form_state->setError($form, $this->t('You have already sent a request')); } } Loading