New Email page won't cancel unless required fields are completed
Overview
When the Cancel button on a New Email is clicked, the cancel action is refused if the required fields are not completed.
Reproduction steps
- Click on Contacts -> New Email.
- Click "Cancel"
Current behaviour
When clicking "Cancel" the New Email page reloads with this error message:
Please correct the following errors in the form fields below:
To is a required field.
Subject is a required field.
Expected behaviour
User should be taken to the most recently viewed Civi page, or the Civi home
Environment information
- Browser: Chrome 99.0.4844.51
- CiviCRM: 5.39.0
- PHP: 7.4.15
- CMS: Joomla 3.10.6
- Database: MySQL 5.7.36
- Web Server: Apache 2.4.51
Comments
When a new email is created from a Contact - Action > Send an Email and a modal pops up to write the email, the Cancel button on the modal functions as expected.