Extension Overrides disabled "Send Confirmation and Receipt" when offline registering participant
Previously opened on Civicore
Overview
When performing an offline Event Registration, you cannot disable "Send Confirmation and Receipt". The POST handler civicrm/contact/view/participant
sends out emails irrespective of the disabled checkbox on the UI and the disabled default event page configuration.
https://chat.civicrm.org/civicrm/pl/4uy3mp5c3jbtjdx96fif6nk4ie
If you have already posted on https://civicrm.stackexchange.com or https://chat.civicrm.org, please include the link to that conversation.
Reproduction steps
- Open a Contact
- Click on Actions-> Register for Event.
- After any Event, Disable
☑ ️ Send Confirmation and Receipt and Save. - Got a success of "Event registration for Test Email has been added. A confirmation email has been sent to".
(No email should have been sent)
Current behaviour
What happens currently. Please provide error messages, screenshots or gifs (LICEcap, SilentCast) where appropriate.
Currently Sends this payload with a disabled send notification and disabled Payment box
entryURL:
https://example.website/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview%2Fparticipant&page=CiviCRM&reset=1&action=add&cid=497&context=participant
_qf_default:
Participant:upload
MAX_FILE_SIZE: 83886080
_qf_Participant_upload: 1
contact_id: 497
event_id: 15
campaign_id: 8
role_id[]: 1
register_date: 2022-12-27 13:23:00
status_id: 1
source:
hidden_feeblock: 1
hidden_eventFullMsg:
priceSetId: 10
price_16:
price_13:
price_11:
financial_type_id: 4
total_amount: 0
receive_date: 2022-12-27 13:23:00
trxn_id:
contribution_status_id: 1
payment_instrument_id: 4
check_number:
from_email_address: 185
receipt_text:
note:
hidden_custom: 1
hidden_custom_group_count[]: 1
custom_21_-1:
custom_18_-1: 0
custom_19_-1: 0
custom_20_-1: 0
custom_22_-1:
hidden_custom: 1
hidden_custom_group_count[]: 1
hidden_custom: 1
hidden_custom_group_count[]: 1
hidden_custom: 1
hidden_custom_group_count[]: 1
I injected a null value into the options to select from the drop down which changed the parameter of from_email_address: 185
to from_email_address:
Unfortunately, that is not how the post handler determines if to send a message because i got this error:
So it still tried to send with the unset email address.
Expected behaviour
What should happen.
No email is sent.
Environment information
- Browser: Edge 108.0.1462.54
- CiviCRM: 5.56.0, 5.55.3
- PHP: 7.4?
- CMS: Wordpress 6.1.1
- Database: Maria DB
- Web Server: Apache 2
- Extension: CiviMobileAPI 6.1.1
Comments
I'm not skilled in reading how php handles calls and everything, so i can't find the handler that this post query relates to. Any pointers would help!