Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sponsor field is missing on sponsored users when using forced sponsor #5171

Closed
nqb opened this issue Feb 28, 2020 · 0 comments · Fixed by #5172
Closed

Sponsor field is missing on sponsored users when using forced sponsor #5171

nqb opened this issue Feb 28, 2020 · 0 comments · Fixed by #5172

Comments

@nqb
Copy link
Contributor

nqb commented Feb 28, 2020

Describe the bug
When you use "Forced sponsor" field on a Sponsor portal module, sponsor field of sponsored users is not filled with email address of sponsor. That's not the case if you don't use "Forced sponsor" field.

To Reproduce
Steps to reproduce the behavior:

  1. Create a user with Mark a sponsor + email address
  2. Configure a portal module with Forced Sponsor using email address of your sponsor user
  3. Try to register foo user using portal module defined at last step

Sponsor registration works but foo has an empty sponsor field in DB.

Expected behavior
Sponsor field of sponsored users should contain email address of their sponsor.

Additional context
Issue is caused by the fact that when we called update_person_fields function, we didn't pass sponsor variable (defined above) as argument:

$self->update_person_from_fields(additionnal_fields => {notes => $note});

It works for users that don't use "Forced Sponsor" field because update_person_fields function called person_modify function with $self->request_fields and  sponsor email is stored in this hash.

my $sponsor = $self->forced_sponsor || $self->request_fields->{sponsor};

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

Successfully merging a pull request may close this issue.

1 participant