Title:
Internal Server Error on Deleting Non-Existent Marketing Campaign via DELETE /api/v1/settings/marketing/campaigns/{id}
Description:
When attempting to delete a marketing campaign that does not exist (e.g., ID 23), the API returns a 500 Internal Server Error with the message _clone method called on non-object, leaking stack trace and internal code paths.
Affected Endpoint:
DELETE /api/v1/settings/marketing/campaigns/{id}
Preconditions:
- Campaign with ID
23 does not exist in the system.
Steps to Reproduce:
- Execute this
curl command:
curl -X 'DELETE' \
'http://<host>/api/v1/settings/marketing/campaigns/23' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <access_token>'
- Observe the response.
Actual Result:
{
"message": "_clone method called on non-object",
"exception": "Error",
...
}
Expected Result:
{
"message": "Campaign with ID 23 not found.",
"status": 404
}