Skip to content

Commit

Permalink
OP-547: Fix for error during registration when agreements are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Sep 25, 2024
1 parent dfb0332 commit b0c2a4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/EventSubscriber/UserRegistrationAgreementSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function processAgreementsFromUserRegister(ResourceControllerEvent $resou

/** @var Collection $userAgreements */
$userAgreements = $customer->getAgreements();
if ($userAgreements->isEmpty()) {
return;
}

$context = $userAgreements->first()->getContexts()[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{ form_row(form.user.plainPassword.first, sylius_test_form_attribute('password-first')) }}
{{ form_row(form.user.plainPassword.second, sylius_test_form_attribute('password-second')) }}

{% if form.agreements is defined %}
{% if form.agreements is defined and form.agreements is not empty %}
<h4 class="ui dividing header">{{ 'bitbag_sylius_agreement_plugin.ui.agreements'|trans }}</h4>

{% for agreement in form.agreements %}
Expand Down

0 comments on commit b0c2a4f

Please sign in to comment.