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

Preserve participant status when transferring #26187

Conversation

larssandergreen
Copy link
Contributor

Before

Whenever a registration was transferred, the status was set to Registered, which is definitely not what should happen if the status was On Waitlist or Pending (Pay Later) or others.

After

On transfer, status maintained.

Comments

In general, transferring seems fairly buggy to me, but I don't think this changes anything one way or another as far as when transferring works or fails for unknown reasons.

@civibot
Copy link

civibot bot commented May 9, 2023

(Standard links)

@civibot civibot bot added the master label May 9, 2023
@@ -475,7 +476,7 @@ public function transferParticipantRegistration($toContactID, $fromParticipantID
])['values'];
unset($toParticipantValues['id']);
$toParticipantValues['contact_id'] = $toContactID;
$toParticipantValues['status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Event_BAO_Participant', 'status_id', 'Registered');
$toParticipantValues['status_id'] = $statusID;
Copy link
Contributor

Choose a reason for hiding this comment

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

@larssandergreen we could also just remove this line couldn't we? - I suspect it could have been required by create in the past but hopefully not now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, much better without.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should resolve the test failure too.

@eileenmcnaughton
Copy link
Contributor

test fail

CRM_Event_Form_ParticipantTest::testTransferParticipantRegistration
ArgumentCountError: Too few arguments to function CRM_Event_Form_SelfSvcTransfer::transferParticipantRegistration(), 2 passed in /home/homer/buildkit/build/build-0/web/sites/all/modules/civicrm/tests/phpunit/CRM/Event/Form/ParticipantTest.php on line 833 and exactly 3 expected

/home/homer/buildkit/build/build-0/web/sites/all/modules/civicrm/CRM/Event/Form/SelfSvcTransfer.php:468
/home/homer/buildkit/build/build-0/web/sites/all/modules/civicrm/tests/phpunit/CRM/Event/Form/ParticipantTest.php:833
/home/homer/buildkit/build/build-0/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:229
/home/homer/buildkit/extern/phpunit8/phpunit8.phar:1721

@larssandergreen larssandergreen force-pushed the Preserve-participant-status-when-transfering branch from 7a57b36 to 2c39a2a Compare May 9, 2023 20:42
@eileenmcnaughton
Copy link
Contributor

thanks @larssandergreen !

@eileenmcnaughton eileenmcnaughton merged commit 198c433 into civicrm:master May 9, 2023
@larssandergreen larssandergreen deleted the Preserve-participant-status-when-transfering branch May 24, 2023 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants