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

File Delete Module for VM #1554

Open
DonRichards opened this issue Jun 29, 2020 · 3 comments
Open

File Delete Module for VM #1554

DonRichards opened this issue Jun 29, 2020 · 3 comments
Labels
Subject: Ansible Playbook Related to the maintenance and upkeep associated with an Ansible Playbook for Islandora. Always also Subject:Deployment related to deployment of Islandora. Usually accompanied by the deployment flavour (Ansible/docker) Type: documentation provides documentation or asks for documentation. Type: enhancement Identifies work on an enhancement to the Islandora codebase

Comments

@DonRichards
Copy link
Member

I believe the file_delete module should be added to the base Ansible scripts and should be a suggested as a recommended module.

file_delete

@DiegoPino
Copy link
Contributor

DiegoPino commented Jun 29, 2020

@DonRichards i from time to time read these notifications. That module won't do what you expect it to do (at least not by default without some extra work), read:

https://www.drupal.org/node/2891902

Basically in D8 files that have no usage are not longer 'deleted' deleted because of many flaws on how that was happening (usage tracking) and people loosing important files

If you want to really delete them, you need to code it or play with some settings (which will then trigger the issue of why it was disabled by default) . We do that in archipelago and its quite a burden but needed.

@DonRichards
Copy link
Member Author

@DiegoPino I don't completely follow you. If a person adds an unnecessary file to an existing node and needs to remove just the file. Is this the scenario you're suggesting to cover?

@DiegoPino
Copy link
Contributor

DiegoPino commented Jun 30, 2020

@DonRichards that is why i shared the link but also my fault to chime in, i was sharing my experience.

Executive summary:

  • You guys use media entities so you don't add a file to a node. You add a file to a media entity that is then related to the node, but the issue is files usage is not always correctly tracked in D8 nor D9. (will assume you know this or read it in the link)
    There is work ongoing and its not working reliably yet. Because of that, Drupal (core, that link i shared) disabled automatic downgrade of permanent files to temporary files when their usage count reaches 0. Why? because Temporary files (which means the ones not tracked to be used by a node, a media, etc) are deleted every certain amount of hours automatically, by default every 6 hours and since tracking is faulty you could end deleting a file that is indeed used. The module you are suggesting (read the release notes) does that manually. Makes a file which is permanent, temporary.

Read the code here:
https://git.drupalcode.org/project/file_delete/-/blob/8.x-1.x/src/Form/FileDeleteForm.php#L95-96
That code does: if Drupal tells the module nobody is using it, then file will be marked as temp and will be removed next time cron runs. And that is the issue. Drupal is not counting correctly how many times it is being used.

So having that module enabled right now is exactly as having this global config:
$config['file.settings']['make_unused_managed_files_temporary'] = TRUE;

Both require you assume Drupal is not (could) not be keeping track correctly of the file usage. That is all i'm saying.

Conclusion: that module gives you a certain level of control. Does not deal with the fact that counting can be wrong and/or you still have (in your case) delete the given media element, which is also attached to your node and then if all is OK, and the file is not being used anywhere, you can press that button. Hope that makes things clearer

@kstapelfeldt kstapelfeldt added Subject:Deployment related to deployment of Islandora. Usually accompanied by the deployment flavour (Ansible/docker) Subject: Ansible Playbook Related to the maintenance and upkeep associated with an Ansible Playbook for Islandora. Always also Type: documentation provides documentation or asks for documentation. Type: enhancement Identifies work on an enhancement to the Islandora codebase and removed Ansible labels Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Subject: Ansible Playbook Related to the maintenance and upkeep associated with an Ansible Playbook for Islandora. Always also Subject:Deployment related to deployment of Islandora. Usually accompanied by the deployment flavour (Ansible/docker) Type: documentation provides documentation or asks for documentation. Type: enhancement Identifies work on an enhancement to the Islandora codebase
Projects
Development

No branches or pull requests

3 participants