Skip to content

IBX-12340: Pass the required struct option when registering from invitation - #140

Open
vidarl wants to merge 1 commit into
5.0from
IBX-12340_registration_from_invitation_returns_500
Open

IBX-12340: Pass the required struct option when registering from invitation#140
vidarl wants to merge 1 commit into
5.0from
IBX-12340_registration_from_invitation_returns_500

Conversation

@vidarl

@vidarl vidarl commented Aug 27, 2026

Copy link
Copy Markdown
🎫 Issue IBX-12340

Related PRs:

Strictly speaking not related, but needed in order to make the invite user functionality work end-to-end (IBX-12339):

Description:

UserRegisterController::registerFromInvitationAction() builds UserRegisterType without the struct option, so /from-invite/register/{hash} always returns HTTP 500 and an invitation can never be accepted.

UserRegisterType::getParent() is BaseContentType, which declares ->setRequired(['languageCode', 'mainLanguageCode', 'struct']) and forwards struct into every fieldsData entry. registerAction() in the same controller passes 'struct' => $data; the invitation variant does not.

Added the missing option, matching registerAction().

For QA:

See ticket for how to reproduce

Documentation:

@sonarqubecloud

Copy link
Copy Markdown

Comment on lines +57 to +65
// Fixtures are imported once per run, so without this the invitation survives into
// InvitationServiceTest, which asserts absolute findInvitations() counts and fails
$connection = self::getDoctrineConnection();
$connection->executeStatement(
'DELETE FROM ibexa_user_invitation_assignment WHERE invitation_id IN '
. '(SELECT id FROM ibexa_user_invitation WHERE email = :email)',
['email' => self::INVITEE_EMAIL]
);
$connection->delete('ibexa_user_invitation', ['email' => self::INVITEE_EMAIL]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What fixture? We are creating an invitation as part of the above test, and DAMADoctrineBundle should cause the transaction to be rolled back after it - this cleanup should not be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants