The Extension Breaks Updating Participants When Contact ID is Included (Drupal Webforms)
When the extension is installed it breaks the API so you can't update existing participants (e.g. changing their status). To recreate the problem you just install the extension and try to use API explorer to update a participant by providing event id, contact id, participant id and participant status for example. Running the API call bellow gives an error.
$result = civicrm_api3('Participant', 'create', [
'event_id' => 37,
'contact_id' => 2,
'id' => 65,
'status_id' => "Registered",
]);
"error_code": "contact_already_registered",
"entity": "Participant",
"action": "create",
"is_error": 1,
However, when I omit the contact id and leave everything else the same, then it magically works.
$result = civicrm_api3('Participant', 'create', [
'event_id' => 37,
'id' => 65,
'status_id' => "Registered",
]);
The call above works just fine.
The problem is that the Drupal Webforms always pass the contact id as well. So the extension essentially breaks updating participants through Drupal Webforms.
I managed to recreate this on two instances, but both were the same version of CiviCRM 5.28.3 using 5.30 civimobileapi
The problem is caused by the exception in CRM_CiviMobileAPI_ApiWrapper_Participant_Create API wrapper.
I think this exception needs to be removed from the extension as it breaks very important functionality with Drupal Webforms.
I've just commented out lines 29 to 31 and the it solves my issues, but I can imagine this causing many headaches to people who use CiviMobile and Drupal Webforms.