Tags for attachments are not properly assigned to the attachment
I'm not sure if this is recent or where it's happening. What happens is that civicrm_entity_tag.entity_id is one higher than the appropriate id from civicrm_file, e.g.
civicrm_file:
id | file_type_id | mime_type | uri |
---|---|---|---|
28 | NULL | text/plain | abc_aef1644a7b96451b6c15b7e34b862f5d.txt |
civicrm_entity_tag:
id | entity_table | entity_id | tag_id |
---|---|---|---|
57 | civicrm_file | --> 29 <-- | 31 |
- Create a tag set for attachments
- Create some tags for the set
- Create an activity
- In the attachments section add a file and choose a tag
- When you go back to view or edit the activity, the tag isn't displayed. Check the db and you'll see the entity_id doesn't match up.
- Manually edit the entity_id in the db and then go back to view the activity. Now the tag is displayed.