DB error message when creating new campaign with existing "External ID"
Overview
When creating a new campaign, an external_id can be added. This external_id must be unique.
However, when a new campaign is entered with an external_id that already exists in the database, there is no error message giving the chance to enter another external_id, but we receive a database error:
Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
DB Error: already exists
Reproduction steps
- Create a new campaign with External ID "10001"
- Create another new campaign with another name but with the same External ID "10001"
- Database error is displayed, leaving thu user puzzled.
Current behaviour
Database error, that gives the user no clue what happened.
Expected behaviour
There should be a message stating "External ID already exists", giving the user the chance to enter another external ID (or leave the field empty).
Environment information
- __CiviCRM:_Master/5.59.x