allow event transfer on backend when self-service transfer is disabled
authorJon Goldberg <jon@megaphonetech.com>
Mon, 26 Apr 2021 19:09:34 +0000 (15:09 -0400)
committerMonish Deb <monish.deb@jmaconsulting.biz>
Wed, 5 May 2021 05:54:08 +0000 (11:24 +0530)
CRM/Event/BAO/Participant.php
tests/phpunit/CRM/Event/BAO/ParticipantTest.php

index 5c719c7964cd384e217f1477985de507113a8c7c..d4a44a57a293c737c4912d1c694c234927f97d54 100644 (file)
@@ -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;
index 42f9a3b7a8dffad7cef4915e0933d3c9f0c33531..c08340b0d4b4e3e010f0e7a52790600e82bca9ac 100644 (file)
@@ -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;
   }