From 5f39745d601faeb734062c05a0c5662d816fb61a Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Mon, 26 Apr 2021 15:09:34 -0400 Subject: [PATCH] allow event transfer on backend when self-service transfer is disabled --- CRM/Event/BAO/Participant.php | 2 +- tests/phpunit/CRM/Event/BAO/ParticipantTest.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 5c719c7964..d4a44a57a2 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -1898,7 +1898,7 @@ WHERE civicrm_participant.contact_id = {$contactID} AND $eventTitle = $dao->title; $eventId = $dao->event_id; } - if (!$details['allow_selfcancelxfer']) { + if (!$details['allow_selfcancelxfer'] && !$isBackOffice) { $details['eligible'] = FALSE; $details['ineligible_message'] = ts('This event registration can not be transferred or cancelled. Contact the event organizer if you have questions.'); return $details; diff --git a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php index 42f9a3b7a8..c08340b0d4 100644 --- a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php +++ b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php @@ -516,6 +516,15 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { 'isBackOffice' => FALSE, 'successExpected' => FALSE, ]; + // Update from back office even when self-service is disabled + $scenarios[] = [ + 'selfSvcEnabled' => 0, + 'selfSvcHours' => 12, + 'hoursToEvent' => 16, + 'participantStatusId' => 1, + 'isBackOffice' => TRUE, + 'successExpected' => TRUE, + ]; return $scenarios; } -- 2.25.1