In the ValidateTags method tags were removed from the list of tags (as the copy made in CheckContentProperties was by reference, it would mutate the original list). This would cause subsequent content items to be processed to not include that tag, leading to incorrect results. This is fixed by not modifying the collection at all, but simply computing the set difference between all tags and the tags that the content is tagged with using Except
When a content item had multiple tag properties, the logic would in theory remove all occurences of the content item in tags that were not in the last tag property. By chance this did not happen, because of the above bug. By rewriting the logic to first collect the tags from all properties, this issue is (re)avoided
There are potentially more issues in the scheduled job logic that are worth checking out, for example:
The job does not take groups into account, which could lead to issues with tags that have the same name but different groups
Theoretically there could be content that has one or more tags, but erroneously isn't attached to any of them. The current logic will not catch and fix that
There is also the question if this job should clean up empty tags, as mentioned in #19
This fixes two issues: