The "versioning" system outlined doesn't seem to actually "version" the documents. It just renames them and doesn't provide you a link to the most recent version of the document, each version has its own.

I'm not too sure on the naming conventions of your database (vid,fid) but perhaps a "file_id" field to govern each file that has the same URL, and a "version" field to govern the current version.

Therefore, if a file is uploaded and it would contain the same URL as another file in the database, then you would assign it the same "file_id" and set the "version" to 0. The file that already exists would then be updated so its version number was equal to the highest version number +1 for that file_id.

This way links to files would always ensure that only the most recent file would be available.

Comments

r_honey’s picture

Category: bug » support

xagelo, the document module has been created as a Drupal node module. The module adds a new content type called "Document". The following description about the working of the module might help you understand the revisioning policy used by the module:

1) The module integrates with the Drupal file system. You have an option for uploading a file, or specifying an external URL for the document. In case you upload a file, it get a corresponding entry in the core Drupal files table, and the file itself is uploaded to the Drupal's files folder.

2) For the revisioning part, the module again provides integration with the concept of revisions for Drupal nodes. You might be knowing that you can create revisions for Drupal nodes, which can be viewed by authorized users using the Revisions tab when viewing a node.

The module allows you to upload a new Document, or change the external document url only when you explicitly create a revision for the document node. In this case, the old url/file is preserved, and the newly uploaded document/new url is associated to the new revision for the Document node.

If you are authorized to View Revisions, whenever you View a revision for a Document, the file attached to that revision is shown/provided for download.

All this means that there is no renaming of files. Once a document is created, the file attached/associated to it cannot be changes unless you create a new revision to the Document node. In the later case, the previous file is still preserved and accessible to authorized users.

The vid, fid in the document table are foreign keys to core Drupal node_revision, files table.

However, I think that it might actually be a good idea to add a version number field to the document node also, where users can enter a desired version number for the document. This is something I would look to implement for a future release.

r_honey’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.