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

Older version of a file isn't deleted when you update or delete it #179

Open
keelanfh opened this issue Jun 2, 2023 · 1 comment
Open

Comments

@keelanfh
Copy link
Member

keelanfh commented Jun 2, 2023

User story

As a content designer
I want to update a document with a new version
So that residents see the up-to-date information

Steps to replicate

  1. View a document in the media library
  2. Edit
  3. Select "Remove"
  4. Upload a new document

image

Expected behaviour

  • Old version of the document is no longer viewable
  • Links to old version of the document are updated to point to the new document
  • Old version of the document does not appear in Linkit (we have a Linkit profile that allows selecting files)

Observed behaviour

  • Old version of document is still available,
  • Links to old version of the document still point to old version of the document
  • Old version of document still appears in Linkit

At admin/content/files, you can still see the file there.

image

Historically, we've faced similar problems with our previous CMS, and it does cause genuine issues where people end up seeing previous versions of documents and rely on out-of-date policy. One mitigation we've applied in our new site is to serve a noindex header to block Google from indexing documents altogether.

I'd be interested to know:

  • Do others have similar expectations of how this functionality should behave?
  • Anything we can do to improve this?
@stephen-cox
Copy link
Member

This is a classic Drupal issue and is a particular issue with Councils needing to publish up to date information, but the old file is being returned by Google searches.

Drupal doesn't delete files as it can be possible to link to them in ways that Drupal doesn't know about. It's fine is every file is only referenced through a File or Media entity, but it's possible to link directly to files in text and Drupal has no way to track these. This is described here: https://www.drupal.org/node/2891902

There are a number of modules that can be used to delete files:

  • File Delete deletes all temporary files (files marked as unused) after a given time.
  • Media Delete gives the option to delete a file when deleting a media item.

I'm sure there are some others that could be considered as well.

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

No branches or pull requests

2 participants