Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep "EntityFile" records available until after Symfony "delete" hooks fire #22994

Closed
wants to merge 1 commit into from

Conversation

christianwach
Copy link
Member

Overview

Solves a small part of problems raised in this Lab issue.

@civibot
Copy link

civibot bot commented Mar 21, 2022

(Standard links)

@civibot civibot bot added the master label Mar 21, 2022
@christianwach
Copy link
Member Author

Genuinely no idea why checks have failed on this - all I did was move a block of code 🤷

@demeritcowboy
Copy link
Contributor

The test fail makes sense to me. Attachments/files can be attached to more than one instance of an entity, e.g. the same file can be attached to two activities. So civi checks the reference count for attachments before removing from the filesystem. Because the reference isn't deleted until after that check now, it thinks there's still an entity instance using the file, so it won't delete the physical file.

@christianwach
Copy link
Member Author

Ah dammit, thanks @demeritcowboy. Back to the drawing board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants