- Alice reads a post
- Alice clicks the "PM" button to quote the post and having the post author as pre-filled recipient
- Alice adds text to the PM
- Bob deletes that post
- Alice clicks "Preview" or "Submit" or wants to add another recipient and hits "Add"
- Alice gets the error "Private message could not be found"
Improvement: while I understand, that step #2 should fail if the post is already not available anymore, it is quite annoying after typing a long PM and later get that halfway misleading message - your only chance is to compose a new PM, which means filling in all recipients, the subject, the post text and adjusting all settings anew. Just because the refering post doesn't exist anymore.
As a consquence, I suggest to not throw an error message once the PM has been shown in the editor, which means upon each HTTP POST request or certain HTTP GET requests it shouldn't been shown anymore.
Open /includes/ucp/ucp_pm_compose.php and find:After, add:
Find: After, add: