-
-
Couldn't load subscription status.
- Fork 6.2k
Closed
Labels
issue/criticalThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPtype/bug
Milestone
Description
- Gitea version (or commit ref): 1.4.2 / af57d6a
- Git version: N/A
- Operating system: N/A
- Database:
- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes
(provide example URL) - No
- Not relevant
- Yes
- Log gist: N/A
Description
Steps to Reproduce
- Create repository: "Repo1"
- Create an issue and upload some attachments
(https://try.gitea.io allowimage/jpeg|image/png|application/zip|application/gzip) - Create repository: "Repo2"
- Create an issue in "Repo2"
- Delete "Repo2"
- Any attachments uploaded to issue/release/PR were accidentally deleted from database and disk, no matter which user uploaded the files (Attachments uploaded to comment are not affected)
I think it's caused by #1092
Line 1845 in af57d6a
| if _, err = sess.In("issue_id", issueIDs).Delete(&Comment{}); err != nil { |
c.ID == 0 here
Lines 149 to 155 in af57d6a
| func (c *Comment) AfterDelete() { | |
| _, err := DeleteAttachmentsByComment(c.ID, true) | |
| if err != nil { | |
| log.Info("Could not delete files for comment %d on issue #%d: %s", c.ID, c.IssueID, err) | |
| } | |
| } |
Screenshots
N/A
Metadata
Metadata
Assignees
Labels
issue/criticalThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPtype/bug