Update Delete.php to mark group folders as deleted RE:#9028 #10059 #10084
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When group email accounts are deleted the associated folders don't get marked as deleted=1 in the folders table. This means they show up for users in folder selection because is shows all folder not equal to deleted=1 (among a few other conditions). They should be marked as deleted when the inbound group email account is deleted. There is in fact, functionality to do this in SugarFolders.php but is is not called when an inbound group email is deleted. This additional code just calls the existing function delete() when an inbound email account is deleted.
Description
This is an addtion to delete.php file simply to get the ID of the folder that is being deleted and then to call and pass it along to SugarFolders.php. There are two functions that then get processed: delete() which also then calls deleteChildrenCascade($id) to delete the child folders.
This is related to the general issue #9028 there are various problems related to group emails. This is one.
#9028 #10059
Motivation and Context
This change is required so that the delete function gets called properly and the folders from the folders table are marked deleted as they should be.
How To Test This
Create a group inbound email account. Ensure you have subscribed the user to folders so they are created.
Delete the inbound group email account, after application of this change, the INBOX (parent folder) and the children folders of the inbound email account should now be updated such that deleted="1" in the folders table.
Types of changes
Final checklist