[ticket/12174] Update topic_attachment flag when a post is soft-deleted
* Nicofuma/ticket/12174:
[ticket/12174] Add tests
[ticket/12174] Coding style
[ticket/12174] Remove $update_topic_attachments_flag
[ticket/12174] Don't update the flag for a post without attachment
[ticket/12174] Update the conditions
[ticket/12174] Remove inline assignment
[ticket/12174] Update sql query
[ticket/12174] Revert the changes on $topic_update_array
[ticket/12174] Corrections
[ticket/12174] Update topic_attachment flag when a post is soft-deleted
This also makes sync('topic_visibility') obsolete, but we keep it for now.
Also fix a unit test, because ITEM_DELETED overpowers ITEM_UNAPPROVED
PHPBB3-9567
Limit the posts to a certain visibility and deletion time
This allows us to only restore posts, that were approved
when the topic got soft deleted. So previous soft deleted
and unapproved posts are still soft deleted/unapproved
PHPBB3-9567