Finding the newest revision of a file

Events happening in the community are now at Drupal community events on www.drupal.org.
deviantintegral's picture

I've created and deployed a module for a client which aims to provide a stable link to the newest version of a file on a revisioned node. I'd actually forgotten about the code (which is why it hasn't been created as a project yet), but before I do so, does any other module available offer this functionality?

Here's the problem it aims to solve:

  • Create a node with an attached file. Say the file is called "file.txt".
  • Send out an email with a link to the file (http://example.com/files/file.txt). This could happen from a contrib module or manually from a user copying the link.
  • Realize there is a typo in the file. Edit the node, create a new revision (this could also be enforced by the admin), delete the file, and upload the replacement "file.txt".
  • Drupal keeps revisions of the older file for the older node revision. So, when you upload, file.txt becomes file_0.txt. Those downloading via email are going to get the old file!

As is, the module works in the following manner:

  • Add a new menu callback at /file-newest.
  • When a user goes to a URL such as http://example.com/file-newest/files/file.txt, the module finds the latest revision of the file (for example, file_99.txt). It then redirects the user to that file to that file.

So, think this is worth it to put up as a project?

Comments

For anyone interested, I've

deviantintegral's picture

For anyone interested, I've uploaded this module over at http://drupal.org/project/file_newest_revision.

Contributed Module Ideas

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: