localgovdrupal / localgov_core

LocalGovDrupal Core module, for helper functions and core dependencies.
GNU General Public License v2.0
3 stars 6 forks source link

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

Open keelanfh opened 1 year ago

keelanfh commented 1 year ago

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

Observed behaviour

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:

stephen-cox commented 1 year ago

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:

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